NogginBops / ImGui.NET_OpenTK_Sample

A sample project showing an ImGui (using ImGui.NET) renderer for OpenTK in C#
106 stars 27 forks source link

Cursor offset #17

Closed Khhs167 closed 2 years ago

Khhs167 commented 2 years ago

The cursor has a notable offset between window position and the position ImGUI uses, any idea how to fix it?

NogginBops commented 2 years ago

Can you show a screenshot of this behavior? Are you using anything like a different viewport or something like that while not compensating for it in ImGui?

Khhs167 commented 2 years ago

I managed to fix it. Unsure how i did it, but I am fairly certain the fix was in GameWindow.OnResize where I set the size with controller.WindowResized(Size.X, Size.Y); whereas the fix was to simply to do controller.WindowResized(e.X, e.Y);, and e is the ResizeEventArgs passed into the function. Thanks for the quick response and I hope anyone who has the same issue finds this useful!