Added option to Pan using tile coordinates.
Fixed incorrect panning.
This commit is contained in:
parent
7793fe823f
commit
cdc999ad42
@ -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).
|
||||
|
Loading…
Reference in New Issue
Block a user