diff --git a/play/isometricprojection.go b/play/isometricprojection.go index 4a18b0c..b731cdd 100644 --- a/play/isometricprojection.go +++ b/play/isometricprojection.go @@ -83,7 +83,12 @@ func (p *IsometricProjection) MoveCenterTo(tile geom.PointF32) { // Pan translates the center of the projection with the given delta in view coordinates. func (p *IsometricProjection) Pan(delta geom.PointF32) { - p.MoveCenterTo(p.center.Add(delta.Mul(p.zoomInverse))) + p.PanTile(p.ViewToTileRelative(delta)) +} + +// PanTile translates the center of the projection with the given delta in tile coordinates. +func (p *IsometricProjection) PanTile(delta geom.PointF32) { + p.MoveCenterTo(p.center.Add(delta)) } // SetTileSize sets the size of a single tile (maximum width & height difference of its corners).