Index: sky/sdk/lib/example/raw/hello_world.dart |
diff --git a/sky/sdk/lib/example/raw/hello_world.dart b/sky/sdk/lib/example/raw/hello_world.dart |
index 116ab1015e91330379bcb49645674ebf452d02f5..9dc7b448decc002620692b1c69ea8e8c8292d28f 100644 |
--- a/sky/sdk/lib/example/raw/hello_world.dart |
+++ b/sky/sdk/lib/example/raw/hello_world.dart |
@@ -6,15 +6,14 @@ import "dart:math"; |
import 'dart:sky'; |
Picture draw(int a, int r, int g, int b) { |
- double width = view.width; |
- double height = view.height; |
+ Size size = new Size(view.width, view.height); |
PictureRecorder recorder = new PictureRecorder(); |
- Canvas canvas = new Canvas(recorder, width, height); |
- double radius = min(width, height) * 0.45; |
+ Canvas canvas = new Canvas(recorder, size); |
+ double radius = size.shortestSide * 0.45; |
Paint paint = new Paint()..color = new Color.fromARGB(a, r, g, b); |
- canvas.drawCircle(width / 2, height / 2, radius, paint); |
+ canvas.drawCircle(size.center, radius, paint); |
return recorder.endRecording(); |
} |