Fixed bug where mouse was released outside terrain area when dragging it kept dragging.
This commit is contained in:
parent
66eaa054c5
commit
b7b663ddb5
@ -63,12 +63,9 @@ func (r *terrainRenderer) Handle(ctx ui.Context, event ui.Event) bool {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
case *ui.MouseButtonUpEvent:
|
case *ui.MouseButtonUpEvent:
|
||||||
pos := e.Pos()
|
if _, ok := r.drag.IsDragging(); ok {
|
||||||
if pos.In(r.interactBounds) {
|
r.game.Terrain.Center = r.isometric.TileInt(r.isometric.Center())
|
||||||
if _, ok := r.drag.IsDragging(); ok {
|
r.drag.Cancel()
|
||||||
r.game.Terrain.Center = r.isometric.TileInt(r.isometric.Center())
|
|
||||||
r.drag.Cancel()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
case *ui.MouseMoveEvent:
|
case *ui.MouseMoveEvent:
|
||||||
pos := e.Pos()
|
pos := e.Pos()
|
||||||
|
Loading…
Reference in New Issue
Block a user