Use FractionalOffset for gradients

These were using Offsets, but they're really FractionalOffsets.

Fixes #2318
This commit is contained in:
Adam Barth
2016-03-15 19:30:41 -07:00
parent 0eea48c8bd
commit 502a4ae078
5 changed files with 18 additions and 21 deletions

View File

@@ -285,8 +285,8 @@ class GradientNode extends NodeWithSize {
Rect rect = Point.origin & size;
Paint gradientPaint = new Paint()..shader = new LinearGradient(
begin: const Offset(0.0, 0.0),
end: const Offset(0.0, 1.0),
begin: const FractionalOffset(0.0, 0.0),
end: const FractionalOffset(0.0, 1.0),
colors: <Color>[colorTop, colorBottom],
stops: <double>[0.0, 1.0]
).createShader(rect);