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

Unified Diff: sky/examples/raw/sector_layout.dart

Issue 1164393002: Convert everything in the Sky API from degrees to radians. (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/examples/raw/painting.sky ('k') | sky/examples/raw/spinning_image.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/examples/raw/sector_layout.dart
diff --git a/sky/examples/raw/sector_layout.dart b/sky/examples/raw/sector_layout.dart
index 1c8ed3fdf69ac411360a4cde0c637ab86879e6b2..aa87ac7f7e28af7fe66844396b2ddb65b36694bd 100644
--- a/sky/examples/raw/sector_layout.dart
+++ b/sky/examples/raw/sector_layout.dart
@@ -10,8 +10,6 @@ import 'package:sky/framework/rendering/object.dart';
const double kTwoPi = 2 * math.PI;
-double deg(double radians) => radians * 180.0 / math.PI;
-
class SectorConstraints {
const SectorConstraints({
this.minDeltaRadius: 0.0,
@@ -128,10 +126,10 @@ class RenderDecoratedSector extends RenderSector {
Path path = new Path();
double outerRadius = (parentData.radius + deltaRadius);
Rect outerBounds = new Rect.fromLTRB(-outerRadius, -outerRadius, outerRadius, outerRadius);
- path.arcTo(outerBounds, deg(parentData.theta), deg(deltaTheta), true);
+ path.arcTo(outerBounds, parentData.theta, deltaTheta, true);
double innerRadius = parentData.radius;
Rect innerBounds = new Rect.fromLTRB(-innerRadius, -innerRadius, innerRadius, innerRadius);
- path.arcTo(innerBounds, deg(parentData.theta + deltaTheta), deg(-deltaTheta), false);
+ path.arcTo(innerBounds, parentData.theta + deltaTheta, -deltaTheta, false);
path.close();
canvas.drawPath(path, paint);
}
« no previous file with comments | « sky/examples/raw/painting.sky ('k') | sky/examples/raw/spinning_image.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698