fix: Animator.zoomTo()
This commit is contained in:
parent
46ad2be83b
commit
5cffe3a3b3
@ -131,13 +131,14 @@ public class Animator {
|
|||||||
|
|
||||||
public synchronized void animateZoom(long duration, double scaleBy,
|
public synchronized void animateZoom(long duration, double scaleBy,
|
||||||
float pivotX, float pivotY) {
|
float pivotX, float pivotY) {
|
||||||
mMap.getMapPosition(mStartPos);
|
mMap.getMapPosition(mCurPos);
|
||||||
|
|
||||||
if (mState == ANIM_SCALE)
|
if (mState == ANIM_SCALE)
|
||||||
scaleBy = (mStartPos.scale + mDeltaPos.scale) * scaleBy;
|
scaleBy = (mStartPos.scale + mDeltaPos.scale) * scaleBy;
|
||||||
else
|
else
|
||||||
scaleBy = mStartPos.scale * scaleBy;
|
scaleBy = mCurPos.scale * scaleBy;
|
||||||
|
|
||||||
|
mStartPos.copy(mCurPos);
|
||||||
scaleBy = clamp(scaleBy, Viewport.MIN_SCALE, Viewport.MAX_SCALE);
|
scaleBy = clamp(scaleBy, Viewport.MIN_SCALE, Viewport.MAX_SCALE);
|
||||||
|
|
||||||
mDeltaPos.scale = scaleBy - mStartPos.scale;
|
mDeltaPos.scale = scaleBy - mStartPos.scale;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user