From 68565eb31785e082c39e38f5562c1b7b204be57c Mon Sep 17 00:00:00 2001 From: Adam Barth Date: Fri, 7 Aug 2015 14:47:06 -0700 Subject: [PATCH] Use localToGlobal and globalToLocal in MimicOverlay Also, make RenderStack support negative positions with clipping so that we can expand objects that are partially offscreen. --- packages/flutter/lib/rendering/stack.dart | 21 +++++++++++++++---- packages/flutter/lib/widgets/mimic.dart | 3 +-- .../flutter/lib/widgets/mimic_overlay.dart | 2 +- 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/packages/flutter/lib/rendering/stack.dart b/packages/flutter/lib/rendering/stack.dart index ff477fc34e..8b7a2b7a27 100644 --- a/packages/flutter/lib/rendering/stack.dart +++ b/packages/flutter/lib/rendering/stack.dart @@ -38,12 +38,13 @@ class RenderStack extends RenderBox with ContainerRenderObjectMixin= 0.0 && x + child.size.width <= size.width); + + if (x < 0.0 || x + child.size.width > size.width) + _hasVisualOverflow = true; double y = 0.0; if (childData.top != null) y = childData.top; else if (childData.bottom != null) y = size.height - childData.bottom - child.size.height; - assert(y >= 0.0 && y + child.size.height <= size.height); + + if (y < 0.0 || y + child.size.height > size.height) + _hasVisualOverflow = true; childData.position = new Point(x, y); } @@ -196,6 +202,13 @@ class RenderStack extends RenderBox with ContainerRenderObjectMixin