Merge pull request #28 from bennybroseph/patch-1

Fix Issue #27
internals
Eric Mellino 7 years ago committed by GitHub
commit bd1e12c39f
  1. 2
      src/ImGui.NET.SampleProgram/SampleWindow.cs

@ -319,7 +319,7 @@ namespace ImGuiNET
MouseState cursorState = Mouse.GetCursorState(); MouseState cursorState = Mouse.GetCursorState();
MouseState mouseState = Mouse.GetState(); MouseState mouseState = Mouse.GetState();
if (_nativeWindow.Bounds.Contains(cursorState.X, cursorState.Y)) if (_nativeWindow.Focused)
{ {
Point windowPoint = _nativeWindow.PointToClient(new Point(cursorState.X, cursorState.Y)); Point windowPoint = _nativeWindow.PointToClient(new Point(cursorState.X, cursorState.Y));
io.MousePosition = new System.Numerics.Vector2(windowPoint.X / io.DisplayFramebufferScale.X, windowPoint.Y / io.DisplayFramebufferScale.Y); io.MousePosition = new System.Numerics.Vector2(windowPoint.X / io.DisplayFramebufferScale.X, windowPoint.Y / io.DisplayFramebufferScale.Y);

Loading…
Cancel
Save