From b656316b4b44db7e9654557224e27da4dce9a398 Mon Sep 17 00:00:00 2001 From: Adam Barth Date: Thu, 11 Jun 2015 10:09:39 -0700 Subject: [PATCH] Make the popup menu animation correct This CL wires up the opacity of the popup menu items and teaches the popup menu how to draw its background at the right size. R=ianh@google.com Review URL: https://codereview.chromium.org/1175353002. --- examples/stocks2/lib/stock_arrow.dart | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/stocks2/lib/stock_arrow.dart b/examples/stocks2/lib/stock_arrow.dart index 3f2bab6ff2..f78b253dc6 100644 --- a/examples/stocks2/lib/stock_arrow.dart +++ b/examples/stocks2/lib/stock_arrow.dart @@ -32,12 +32,12 @@ class StockArrow extends Component { UINode build() { // TODO(jackson): This should change colors with the theme Color color = _colorForPercentChange(percentChange); - const double size = 40.0; - var arrow = new CustomPaint(callback: (sky.Canvas canvas) { + const double kSize = 40.0; + var arrow = new CustomPaint(callback: (sky.Canvas canvas, Size size) { Paint paint = new Paint()..color = color; paint.strokeWidth = 1.0; var padding = paint.strokeWidth * 3.0; - var r = size / 2.0 - padding; + var r = kSize / 2.0 - padding; canvas.save(); canvas.translate(padding, padding); @@ -68,8 +68,8 @@ class StockArrow extends Component { return new Container( child: arrow, - width: size, - height: size, + width: kSize, + height: kSize, margin: const EdgeDims.symmetric(horizontal: 5.0)); }