Fix viewport zoom repositioning ignoring map bounds
This commit is contained in:
@@ -108,7 +108,9 @@ namespace OpenRA.Graphics
|
||||
var oldCenter = worldRenderer.Viewport.ViewToWorldPx(center);
|
||||
AdjustZoom(dz);
|
||||
var newCenter = worldRenderer.Viewport.ViewToWorldPx(center);
|
||||
CenterLocation += oldCenter - newCenter;
|
||||
|
||||
var candidateCenterLocation = CenterLocation + oldCenter - newCenter;
|
||||
CenterLocation = candidateCenterLocation.Clamp(mapBounds);
|
||||
}
|
||||
|
||||
public void ToggleZoom()
|
||||
|
||||
Reference in New Issue
Block a user