diff --git a/PrismOS/Libraries/Runtime.cs b/PrismOS/Libraries/Runtime.cs index 548f37e9..970760b6 100644 --- a/PrismOS/Libraries/Runtime.cs +++ b/PrismOS/Libraries/Runtime.cs @@ -46,13 +46,20 @@ public static void Update() #region Calculations E.OnUpdate.Invoke(); - if (E.Clicked && Mouse.MouseState != Cosmos.System.MouseState.Left && !Dragging) - { - E.Clicked = false; - E.OnClick.Invoke(); + + if (IsMouseWithin(Window.X+E.X, Window.Y+E.Y, E.Width, E.Height)) { + E.Hovering=true; + if (Cosmos.System.MouseManager.MouseState==Cosmos.System.MouseState.Left) { + E.Clicked=true; + } else { + if (E.Clicked) { + E.Clicked=false; + E.OnClick(); + } + } + } else { + E.Hovering=false; } - E.Hovering = Mouse.X >= E.X && Mouse.IsMouseWithin(E.X, E.Y, E.Width, E.Height); - E.Clicked = E.Hovering && Mouse.MouseState == Cosmos.System.MouseState.Left; #endregion @@ -100,4 +107,4 @@ public static void Stop() Cosmos.System.Power.Shutdown(); } } -} \ No newline at end of file +}