Skip to content

Commit

Permalink
Fix double click
Browse files Browse the repository at this point in the history
  • Loading branch information
kaczy93 committed Jan 7, 2024
1 parent c527971 commit 4ee6612
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions CentrED/Map/MapManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -461,15 +461,16 @@ public void Update(GameTime gameTime, bool isActive, bool processMouse, bool pro
{
_mouseDrag = false;
}
if ( _prevMouseState.LeftButton == ButtonState.Pressed && mouseState.LeftButton == ButtonState.Released)
{
ActiveTool.OnMouseReleased(Selected);
Selected = null; //Very dirty way to retrigger OnMouseEnter() after something presumably changed
}
}
else
{
ActiveTool.OnMouseLeave(Selected);
}
if ( _prevMouseState.LeftButton == ButtonState.Pressed && mouseState.LeftButton == ButtonState.Released)
{
ActiveTool.OnMouseReleased(Selected);
}
_prevMouseState = mouseState;

if (isActive && processKeyboard)
Expand Down

0 comments on commit 4ee6612

Please sign in to comment.