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

Unified Diff: sky/sdk/lib/example/raw/launcher.dart

Issue 1214833004: Split Size into Size and Offset. (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
« no previous file with comments | « sky/sdk/lib/example/raw/hello_world.dart ('k') | sky/sdk/lib/example/raw/painting.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/sdk/lib/example/raw/launcher.dart
diff --git a/sky/sdk/lib/example/raw/launcher.dart b/sky/sdk/lib/example/raw/launcher.dart
index 69625cae4c979464347fd3145023571eccd6cbbc..96dfc39bfef0a597d35c937a12825f3a440a0cf9 100644
--- a/sky/sdk/lib/example/raw/launcher.dart
+++ b/sky/sdk/lib/example/raw/launcher.dart
@@ -9,15 +9,14 @@ import 'package:sky/framework/shell.dart' as shell;
import 'package:mojom/intents/intents.mojom.dart';
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.drawRect(new Rect.fromSize(new Size(width, height)), paint);
+ canvas.drawRect(new Rect.fromSize(size), paint);
return recorder.endRecording();
}
« no previous file with comments | « sky/sdk/lib/example/raw/hello_world.dart ('k') | sky/sdk/lib/example/raw/painting.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698