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

Unified Diff: sky/sdk/lib/framework/rendering/box.dart

Issue 1145263006: Add RenderClip and use it in FixedHeightScrollable (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/sdk/lib/framework/fn2.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/sdk/lib/framework/rendering/box.dart
diff --git a/sky/sdk/lib/framework/rendering/box.dart b/sky/sdk/lib/framework/rendering/box.dart
index 7d7ff51150f10062609eb5b27891046dcaddc0ee..cbbfc658aa42ecba1f7ec4a2af0eaab54d365dac 100644
--- a/sky/sdk/lib/framework/rendering/box.dart
+++ b/sky/sdk/lib/framework/rendering/box.dart
@@ -217,6 +217,19 @@ class RenderSizedBox extends RenderProxyBox {
}
}
+class RenderClip extends RenderProxyBox {
+ RenderClip({ RenderBox child }) : super(child);
+
+ void paint(RenderObjectDisplayList canvas) {
+ if (child != null) {
+ canvas.save();
+ canvas.clipRect(new sky.Rect.fromSize(size));
+ child.paint(canvas);
+ canvas.restore();
+ }
+ }
+}
+
class RenderPadding extends RenderBox with RenderObjectWithChildMixin<RenderBox> {
RenderPadding({ EdgeDims padding, RenderBox child }) {
« no previous file with comments | « sky/sdk/lib/framework/fn2.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698