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

Side by Side Diff: sky/examples/stocks2/lib/stock_arrow.dart

Issue 1214833004: Split Size into Size and Offset. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: add the new files also 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 import 'dart:math' as math; 5 import 'dart:math' as math;
6 import 'dart:sky' as sky; 6 import 'dart:sky' as sky;
7 7
8 import 'package:sky/rendering/box.dart'; 8 import 'package:sky/rendering/box.dart';
9 import 'package:sky/rendering/object.dart'; 9 import 'package:sky/rendering/object.dart';
10 import 'package:sky/theme/colors.dart' as colors; 10 import 'package:sky/theme/colors.dart' as colors;
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 Path path = new Path(); 54 Path path = new Path();
55 path.moveTo(centerX, arrowY - h); // top of the arrow 55 path.moveTo(centerX, arrowY - h); // top of the arrow
56 path.lineTo(centerX + w, arrowY + h); 56 path.lineTo(centerX + w, arrowY + h);
57 path.lineTo(centerX - w, arrowY + h); 57 path.lineTo(centerX - w, arrowY + h);
58 path.close(); 58 path.close();
59 paint.setStyle(sky.PaintingStyle.fill); 59 paint.setStyle(sky.PaintingStyle.fill);
60 canvas.drawPath(path, paint); 60 canvas.drawPath(path, paint);
61 61
62 // Draw a circle that circumscribes the arrow. 62 // Draw a circle that circumscribes the arrow.
63 paint.setStyle(sky.PaintingStyle.stroke); 63 paint.setStyle(sky.PaintingStyle.stroke);
64 canvas.drawCircle(centerX, centerY, r, paint); 64 canvas.drawCircle(new Point(centerX, centerY), r, paint);
65 }); 65 });
66 66
67 return new Container( 67 return new Container(
68 child: arrow, 68 child: arrow,
69 width: kSize, 69 width: kSize,
70 height: kSize, 70 height: kSize,
71 margin: const EdgeDims.symmetric(horizontal: 5.0) 71 margin: const EdgeDims.symmetric(horizontal: 5.0)
72 ); 72 );
73 } 73 }
74 74
75 } 75 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698