Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Side by Side Diff: Source/platform/geometry/FloatRoundedRect.h

Issue 1137513003: Apply bleed-avoidance insets _after_ constraining the border (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. 2 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above 8 * 1. Redistributions of source code must retain the above
9 * copyright notice, this list of conditions and the following 9 * copyright notice, this list of conditions and the following
10 * disclaimer. 10 * disclaimer.
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
109 void move(const FloatSize& size) { m_rect.move(size); } 109 void move(const FloatSize& size) { m_rect.move(size); }
110 void inflateWithRadii(int size); 110 void inflateWithRadii(int size);
111 void inflate(float size) { m_rect.inflate(size); } 111 void inflate(float size) { m_rect.inflate(size); }
112 112
113 // expandRadii() does not have any effect on corner radii which have zero wi dth or height. This is because the process of expanding 113 // expandRadii() does not have any effect on corner radii which have zero wi dth or height. This is because the process of expanding
114 // the radius of a corner is not allowed to make sharp corners non-sharp. Th is applies when "spreading" a shadow or 114 // the radius of a corner is not allowed to make sharp corners non-sharp. Th is applies when "spreading" a shadow or
115 // a box shape. 115 // a box shape.
116 void expandRadii(float size) { m_radii.expand(size); } 116 void expandRadii(float size) { m_radii.expand(size); }
117 void shrinkRadii(float size) { m_radii.shrink(size); } 117 void shrinkRadii(float size) { m_radii.shrink(size); }
118 118
119 void shrink(const FloatRectOutsets&);
120
119 // Returns a quickly computed rect enclosed by the rounded rect. 121 // Returns a quickly computed rect enclosed by the rounded rect.
120 FloatRect radiusCenterRect() const; 122 FloatRect radiusCenterRect() const;
121 123
122 FloatRect topLeftCorner() const 124 FloatRect topLeftCorner() const
123 { 125 {
124 return FloatRect(m_rect.x(), m_rect.y(), m_radii.topLeft().width(), m_ra dii.topLeft().height()); 126 return FloatRect(m_rect.x(), m_rect.y(), m_radii.topLeft().width(), m_ra dii.topLeft().height());
125 } 127 }
126 FloatRect topRightCorner() const 128 FloatRect topRightCorner() const
127 { 129 {
128 return FloatRect(m_rect.maxX() - m_radii.topRight().width(), m_rect.y(), m_radii.topRight().width(), m_radii.topRight().height()); 130 return FloatRect(m_rect.maxX() - m_radii.topRight().width(), m_rect.y(), m_radii.topRight().width(), m_radii.topRight().height());
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 200
199 201
200 inline bool operator==(const FloatRoundedRect& a, const FloatRoundedRect& b) 202 inline bool operator==(const FloatRoundedRect& a, const FloatRoundedRect& b)
201 { 203 {
202 return a.rect() == b.rect() && a.radii() == b.radii(); 204 return a.rect() == b.rect() && a.radii() == b.radii();
203 } 205 }
204 206
205 } // namespace blink 207 } // namespace blink
206 208
207 #endif // FloatRoundedRect_h 209 #endif // FloatRoundedRect_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698