You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// Zooms in by one.ScalablezoomIn() =>Scalable(zoom: zoom +1);
/// Zooms out by one. /// /// The minimum value for [zoom] of the returned scalable object is 0.ScalablezoomOut() =>Scalable(zoom: math.max(zoom -1, 0));
/// Zooms to the [zoom] level (a positive number).ScalablezoomTo(covariantnum zoom) =>Scalable(zoom: zoom);
Scalable2i:
@overrideScalable2izoomIn() =>Scalable2i(
zoom: zoom +1,
x: x <<1,
y: y <<1,
);
@overrideScalable2izoomOut() => zoom ==0?this:Scalable2i(
zoom: zoom -1,
x: x >>1,
y: y >>1,
);
@overrideScalable2izoomTo(int zoom) {
assert(zoom >=0, 'Zoom must be >= 0');
if (this.zoom == zoom) {
returnthis;
}
final shift = zoom -this.zoom;
return shift >0?Scalable2i(
zoom: zoom,
x: x << shift,
y: y << shift,
)
:Scalable2i(
zoom: zoom,
x: x >> shift.abs(),
y: y >> shift.abs(),
);
}
The text was updated successfully, but these errors were encountered:
Scalable
base class:Scalable2i
:The text was updated successfully, but these errors were encountered: