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

Unified Diff: sky/sdk/lib/rendering/paragraph.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/paragraph.dart
diff --git a/sky/sdk/lib/rendering/paragraph.dart b/sky/sdk/lib/rendering/paragraph.dart
index b3afa86be6570e8d772b6afa0306aa93a36ba850..ce0502f2213a50e6d9e8a73024734b299e8676d3 100644
--- a/sky/sdk/lib/rendering/paragraph.dart
+++ b/sky/sdk/lib/rendering/paragraph.dart
@@ -172,7 +172,7 @@ class RenderParagraph extends RenderBox {
_applyFloatingPointHack(root.height)));
}
- void paint(RenderCanvas canvas) {
+ void paint(RenderCanvas canvas, Offset offset) {
// Ideally we could compute the min/max intrinsic width/height with a
// non-destructive operation. However, currently, computing these values
// will destroy state inside the layout root. If that happens, we need to
@@ -181,7 +181,9 @@ class RenderParagraph extends RenderBox {
// TODO(abarth): Make computing the min/max intrinsic width/height a
// non-destructive operation.
_layout(constraints);
+ canvas.translate(offset.dx, offset.dy);
_layoutRoot.paint(canvas);
+ canvas.translate(-offset.dx, -offset.dy);
abarth-chromium 2015/06/27 00:39:37 Ouch. Can you add a TODO about teaching layoutRoo
}
// we should probably expose a way to do precise (inter-glpyh) hit testing

Powered by Google App Engine
This is Rietveld 408576698