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:
|
||||
pos := e.Pos()
|
||||
if pos.In(r.interactBounds) {
|
||||
if _, ok := r.drag.IsDragging(); ok {
|
||||
r.game.Terrain.Center = r.isometric.TileInt(r.isometric.Center())
|
||||
r.drag.Cancel()
|
||||
}
|
||||
if _, ok := r.drag.IsDragging(); ok {
|
||||
r.game.Terrain.Center = r.isometric.TileInt(r.isometric.Center())
|
||||
r.drag.Cancel()
|
||||
}
|
||||
case *ui.MouseMoveEvent:
|
||||
pos := e.Pos()
|
||||
|
Loading…
Reference in New Issue
Block a user