File tree 2 files changed +4
-9
lines changed
2 files changed +4
-9
lines changed Original file line number Diff line number Diff line change @@ -69,9 +69,6 @@ class Label {
69
69
final labelPosition = polylabel ([
70
70
points.map ((p) => math.Point (p.dx, p.dy)).toList (),
71
71
]);
72
- return Offset (
73
- labelPosition.point.x.toDouble (),
74
- labelPosition.point.y.toDouble (),
75
- );
72
+ return labelPosition.point.toOffset ();
76
73
}
77
74
}
Original file line number Diff line number Diff line change @@ -249,10 +249,8 @@ class MapCamera {
249
249
crs.getProjectedBounds (zoom ?? this .zoom);
250
250
251
251
/// Calculates the [Offset] from the [pos] to this camera's [pixelOrigin] .
252
- Offset getOffsetFromOrigin (LatLng pos) {
253
- final delta = project (pos).subtract (pixelOrigin);
254
- return Offset (delta.x, delta.y);
255
- }
252
+ Offset getOffsetFromOrigin (LatLng pos) =>
253
+ project (pos).subtract (pixelOrigin).toOffset ();
256
254
257
255
/// Calculates the pixel origin of this [MapCamera] at the given
258
256
/// [center] /[zoom] .
@@ -325,7 +323,7 @@ class MapCamera {
325
323
..rotateZ (rotationRad * counterRotationFactor)
326
324
..translate (- mapCenter.x, - mapCenter.y);
327
325
328
- final tp = MatrixUtils .transformPoint (m, Offset ( point.x, point.y ));
326
+ final tp = MatrixUtils .transformPoint (m, point.toOffset ( ));
329
327
330
328
return Point (tp.dx, tp.dy);
331
329
}
You can’t perform that action at this time.
0 commit comments