forked from Mirrors/openclonk
Keep the view in the center of the viewport when changinge Zoom, again
parent
b9345fbf96
commit
bdf65ae34e
|
@ -1207,6 +1207,9 @@ void C4Viewport::AdjustPosition()
|
|||
assert(Zoom>0);
|
||||
assert(ZoomTarget>0);
|
||||
|
||||
float PrefViewX = ViewX + ViewWdt / (Zoom * 2) - ViewOffsX;
|
||||
float PrefViewY = ViewY + ViewHgt / (Zoom * 2) - ViewOffsY;
|
||||
|
||||
if(Zoom != ZoomTarget)
|
||||
{
|
||||
float DeltaZoom = Zoom/ZoomTarget;
|
||||
|
@ -1229,8 +1232,6 @@ void C4Viewport::AdjustPosition()
|
|||
// View position
|
||||
if (PlayerLock && ValidPlr(Player))
|
||||
{
|
||||
float PrefViewX = ViewX + ViewWdt / (Zoom * 2) - ViewOffsX;
|
||||
float PrefViewY = ViewY + ViewHgt / (Zoom * 2) - ViewOffsY;
|
||||
|
||||
float ScrollRange = Min(ViewWdt/(10*Zoom),ViewHgt/(10*Zoom));
|
||||
float ExtraBoundsX = 0, ExtraBoundsY = 0;
|
||||
|
|
Loading…
Reference in New Issue