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..13394da5d5fb80525dd52e36fdf069c7e89a844f 100644 |
| --- a/sky/sdk/lib/rendering/box.dart |
| +++ b/sky/sdk/lib/rendering/box.dart |
| @@ -556,6 +556,26 @@ class RenderClipRect extends RenderProxyBox { |
| } |
| } |
| +class RenderClipRRect extends RenderProxyBox { |
| + final double xRad; |
| + final double yRad; |
|
abarth-chromium
2015/06/25 17:11:21
xRadius and yRadius
Please use complete words in
Hixie
2015/06/25 17:16:58
also, constructors first. fields second or with th
|
| + RenderClipRRect({ RenderBox child, this.xRad, this.yRad }) : super(child) { |
| + assert(xRad != null); |
| + assert(yRad != null); |
| + } |
| + |
| + 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, xRad, yRad); |
|
Hixie
2015/06/25 17:16:59
Doesn't RRect() have a suitable constructor?
Inde
|
| + canvas.clipRRect(rrect); |
|
Hixie
2015/06/25 17:16:59
What's the anti-aliasing story here?
(ok, trick q
|
| + child.paint(canvas); |
| + canvas.restore(); |
| + } |
| + } |
| +} |
| + |
| class RenderClipOval extends RenderProxyBox { |
| RenderClipOval({ RenderBox child }) : super(child); |