Chromium Code Reviews| Index: sky/examples/raw/hello_world.dart |
| diff --git a/sky/examples/raw/hello_world.dart b/sky/examples/raw/hello_world.dart |
| index 4264abf8990f0bee5c78ce2d5bad6f70456e9ee3..89f49188d3c6ee61351d0edd91cc34a5c2080587 100644 |
| --- a/sky/examples/raw/hello_world.dart |
| +++ b/sky/examples/raw/hello_world.dart |
| @@ -5,15 +5,18 @@ |
| import "dart:math"; |
| import 'dart:sky'; |
| +import 'package:sky/rendering/object.dart'; |
|
abarth-chromium
2015/06/23 02:28:45
This demo shouldn't depend on package:sky. It's m
iansf
2015/06/23 22:46:09
Done.
|
| + |
| Picture draw(int a, int r, int g, int b) { |
| double width = view.width; |
| double height = view.height; |
| - PictureRecorder recorder = new PictureRecorder(width, height); |
| + PictureRecorder recorder = new PictureRecorder(); |
| + RenderCanvas canvas = new RenderCanvas(recorder, width, height); |
|
abarth-chromium
2015/06/23 02:28:45
You can just use regular Canvas here.
iansf
2015/06/23 22:46:09
Done.
|
| double radius = min(width, height) * 0.45; |
| Paint paint = new Paint()..color = new Color.fromARGB(a, r, g, b); |
| - recorder.drawCircle(width / 2, height / 2, radius, paint); |
| + canvas.drawCircle(width / 2, height / 2, radius, paint); |
| return recorder.endRecording(); |
| } |