Chromium Code Reviews| Index: sky/sdk/lib/rendering/box.dart |
| diff --git a/sky/sdk/lib/rendering/box.dart b/sky/sdk/lib/rendering/box.dart |
| index 36d700aee1fdbfdd35f625c4cb84e58403955d24..6e9595ea7005112dc6d2daded45a6b99c0d3dbba 100644 |
| --- a/sky/sdk/lib/rendering/box.dart |
| +++ b/sky/sdk/lib/rendering/box.dart |
| @@ -556,6 +556,45 @@ class RenderClipRect extends RenderProxyBox { |
| } |
| } |
| +class RenderClipRRect extends RenderProxyBox { |
| + RenderClipRRect({ RenderBox child, double xRadius, double yRadius }) |
| + : _xRadius = xRadius,_yRadius = yRadius, super(child) { |
|
abarth-chromium
2015/06/25 18:04:12
s/xRadius,_yRadius/xRadius, _yRadius/
|
| + assert(_xRadius != null); |
| + assert(_yRadius != null); |
| + } |
| + |
| + double _xRadius; |
| + double get xRadius => _xRadius; |
| + void set xRadius (double value) { |
| + assert(value != null); |
| + if (_xRadius == value) |
| + return; |
| + _xRadius = value; |
| + markNeedsPaint(); |
| + } |
| + |
| + double _yRadius; |
| + double get yRadius => _yRadius; |
| + void set yRadius (double value) { |
| + assert(value != null); |
| + if (_yRadius == value) |
| + return; |
| + _yRadius = value; |
| + markNeedsPaint(); |
| + } |
| + |
| + void paint(RenderCanvas canvas) { |
| + if (child != null) { |
| + Rect rect = new Rect.fromSize(size); |
| + canvas.saveLayer(rect, new Paint()); |
| + sky.RRect rrect = new sky.RRect()..setRectXY(rect, xRadius, yRadius); |
| + canvas.clipRRect(rrect); |
| + child.paint(canvas); |
| + canvas.restore(); |
| + } |
| + } |
| +} |
| + |
| class RenderClipOval extends RenderProxyBox { |
| RenderClipOval({ RenderBox child }) : super(child); |