Imgui: Bug when resizing window from borders (with io.ConfigResizeWindowsFromEdges=true)

Created on 2 Oct 2018  路  5Comments  路  Source: ocornut/imgui

Version/Branch of Dear ImGui:

  • Branch: docking
  • Commit: 2cff3f6

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

bug

Most helpful comment

The values for io.MousePos are not rounded.

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

All 5 comments

Thank you. I suspect this could be related to non-rounded mouse positions. Could you confirm the io.MousePos value that are being passed to imgui on your setup? Will investigate.

The values for io.MousePos are not rounded.

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

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.)

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!

This should be fixed in all branches now.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bogdaNNNN1 picture bogdaNNNN1  路  3Comments

ocornut picture ocornut  路  3Comments

SlNPacifist picture SlNPacifist  路  3Comments

ghost picture ghost  路  3Comments

mnemode2 picture mnemode2  路  3Comments