Skip to content

Commit

Permalink
Fixes #154
Browse files Browse the repository at this point in the history
  • Loading branch information
rds1983 committed Jan 10, 2020
1 parent 217e95f commit 31bfaae
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 21 deletions.
19 changes: 0 additions & 19 deletions src/Myra/Graphics2D/UI/Desktop.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ public static class Desktop
private static Widget _scheduleMouseWheelFocus;
private static bool _isTouchDown;
private static Point _mousePosition, _touchPosition;
private static Point _lastMousePosition, _lastTouchPosition;
private static bool _contextMenuShown = false;
private static bool _keyboardFocusSet = false;
private static bool _mouseWheelFocusSet = false;
Expand All @@ -81,14 +80,6 @@ public static IReadOnlyCollection<Keys> DownKeys
}
}

internal static Point LastMousePosition
{
get
{
return _lastMousePosition;
}
}

public static Point MousePosition
{
get
Expand All @@ -103,7 +94,6 @@ private set
return;
}

_lastMousePosition = _mousePosition;
_mousePosition = value;
MouseMoved.Invoke();

Expand All @@ -126,14 +116,6 @@ private set
}
}

internal static Point LastTouchPosition
{
get
{
return _lastTouchPosition;
}
}

public static Point TouchPosition
{
get
Expand All @@ -148,7 +130,6 @@ private set
return;
}

_lastTouchPosition = _touchPosition;
_touchPosition = value;
TouchMoved.Invoke();

Expand Down
6 changes: 4 additions & 2 deletions src/Myra/Graphics2D/UI/Widget.cs
Original file line number Diff line number Diff line change
Expand Up @@ -998,6 +998,8 @@ public virtual void UpdateLayout()
_lastLocationHint = new Point(Left, Top);
_layoutState = LayoutState.Normal;

HandleMouseMovement();

LayoutUpdated.Invoke(this);
}

Expand Down Expand Up @@ -1281,7 +1283,7 @@ internal void HandleTouchDoubleClick()
internal bool HandleMouseMovement()
{
var isMouseOver = Bounds.Contains(Desktop.MousePosition);
var wasMouseOver = Bounds.Contains(Desktop.LastMousePosition);
var wasMouseOver = IsMouseInside;

if (isMouseOver && !wasMouseOver)
{
Expand Down Expand Up @@ -1330,7 +1332,7 @@ internal void HandleTouchUp()
internal bool HandleTouchMovement()
{
var isTouchOver = Bounds.Contains(Desktop.TouchPosition);
var wasTouchOver = Bounds.Contains(Desktop.LastTouchPosition);
var wasTouchOver = IsTouchInside;

if (isTouchOver && !wasTouchOver)
{
Expand Down

0 comments on commit 31bfaae

Please sign in to comment.