Fixed incorrect panning.
This commit is contained in:
parent
b7b663ddb5
commit
822d8ab584
@ -77,7 +77,7 @@ func (r *terrainRenderer) Handle(ctx ui.Context, event ui.Event) bool {
|
||||
}
|
||||
if _, ok := r.drag.IsDragging(); ok {
|
||||
delta, _ := r.drag.Move(pos)
|
||||
r.isometric.Pan(r.isometric.ViewToTileRelative(delta.Invert()))
|
||||
r.isometric.Pan(delta.Invert())
|
||||
}
|
||||
if r.hover != nil {
|
||||
if e.MouseWheel < 0 {
|
||||
@ -97,13 +97,13 @@ func (r *terrainRenderer) Handle(ctx ui.Context, event ui.Event) bool {
|
||||
case ui.KeyPadMinus:
|
||||
r.isometric.ZoomOut(r.isometric.Center())
|
||||
case ui.KeyW:
|
||||
r.isometric.Pan(geom.PtF32(-1, -1))
|
||||
r.isometric.PanTile(geom.PtF32(-1, -1))
|
||||
case ui.KeyA:
|
||||
r.isometric.Pan(geom.PtF32(-1, 1))
|
||||
r.isometric.PanTile(geom.PtF32(-1, 1))
|
||||
case ui.KeyS:
|
||||
r.isometric.Pan(geom.PtF32(1, 1))
|
||||
r.isometric.PanTile(geom.PtF32(1, 1))
|
||||
case ui.KeyD:
|
||||
r.isometric.Pan(geom.PtF32(1, -1))
|
||||
r.isometric.PanTile(geom.PtF32(1, -1))
|
||||
}
|
||||
}
|
||||
return false
|
||||
|
Loading…
Reference in New Issue
Block a user