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

Unified Diff: sky/sdk/lib/rendering/object.dart

Issue 1209413004: Instead of applying a transform for every RenderObject, pass down an Offset for where to paint. (Closed) Base URL: https://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
Index: sky/sdk/lib/rendering/object.dart
diff --git a/sky/sdk/lib/rendering/object.dart b/sky/sdk/lib/rendering/object.dart
index 5811ee2c38ecece6dd35631502581e5f2e4ca74e..02995bd645f391dc9edd61fa2a7b9e330639a4f8 100644
--- a/sky/sdk/lib/rendering/object.dart
+++ b/sky/sdk/lib/rendering/object.dart
@@ -29,10 +29,8 @@ class ParentData {
class RenderCanvas extends sky.Canvas {
RenderCanvas(sky.PictureRecorder recorder, Size bounds) : super(recorder, bounds);
- void paintChild(RenderObject child, Point position) {
- translate(position.x, position.y);
- child.paint(this);
- translate(-position.x, -position.y);
+ void paintChild(RenderObject child, Point point) {
+ child.paint(this, point.toOffset());
}
}
@@ -245,7 +243,7 @@ abstract class RenderObject extends AbstractNode implements HitTestTarget {
assert(!debugDoingPaint);
scheduler.ensureVisualUpdate();
}
- void paint(RenderCanvas canvas) { }
+ void paint(RenderCanvas canvas, Offset offset) { }
// EVENTS

Powered by Google App Engine
This is Rietveld 408576698