Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug when resizing window from borders (with io.ConfigResizeWindowsFromEdges=true) #2110

Closed
Alzathar opened this issue Oct 2, 2018 · 5 comments

Comments

@Alzathar
Copy link
Contributor

Alzathar commented Oct 2, 2018

Version/Branch of Dear ImGui:

Back-end file/Renderer/OS: (or specify if you are using a custom engine back-end)

  • Back-ends: example_glfw_opengl3
  • OS: macos 10.12

My Issue/Question: (please provide context)

When you resize a window from the top border, the bottom border moves to the top. The same problem occurs if you resize from the left side (the right side moves to the left).

Screenshots/Video

@ocornut
Copy link
Owner

ocornut commented Oct 2, 2018 via email

@Alzathar
Copy link
Contributor Author

Alzathar commented Oct 2, 2018

The values for io.MousePos are not rounded.

screen shot 2018-10-02 at 10 50 48 am

@ocornut ocornut added the bug label Oct 2, 2018
@ocornut ocornut changed the title Docking: window resizing from borders Bug when resizing window from borders (with io.ConfigResizeWindowsFromEdges=true) Oct 2, 2018
@ocornut
Copy link
Owner

ocornut commented Oct 2, 2018

Thank you, that's probably it then.

If you need a temporary work-around in imgui_impl_glfw.cpp you can replace
io.MousePos = ImVec2((float)mouse_x + viewport->Pos.x, (float)mouse_y + viewport->Pos.y);
With
io.MousePos = ImVec2((float)(int)(mouse_x + viewport->Pos.x), (float)(int)(mouse_y + viewport->Pos.y));
But I will design the fix to work at a lower-level in core imgui.

(As mentioned in the "Desirable Features to enable along with docking" paragraph in the other thread, this is unrelated to Docking, the feature is available on master as well.)

@Alzathar
Copy link
Contributor Author

Alzathar commented Oct 2, 2018

Thanks for this quick fix.

(As mentioned in the "Desirable Features to enable along with docking" paragraph in the other thread, this is unrelated to Docking, the feature is available on master as well.)

I do agree but this issue is only visible in the docking branch because in the other branches (master or viewport) you cannot resize from edges by default. That's why I added "Docking" in the title of this issue. I did not know the option io.ConfigResizeWindowsFromEdges. Thank you for this discovery!

ocornut added a commit that referenced this issue Oct 2, 2018
…a flag) extends the hit region of root floating windows outside the window, making it easier to resize windows. Resize grips are also extended accordingly so there are no discontinuity when hovering between borders and corners. (#1495, #822, #2110)
ocornut added a commit that referenced this issue Oct 2, 2018
…el-rounded by rounding mouse position input. (#2110)
@ocornut
Copy link
Owner

ocornut commented Oct 2, 2018

This should be fixed in all branches now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants