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

Drag and Drop Target Box does not remain within the Window #3272

Closed
Link1J opened this issue May 29, 2020 · 5 comments
Closed

Drag and Drop Target Box does not remain within the Window #3272

Link1J opened this issue May 29, 2020 · 5 comments
Labels
drag drop drag and drop

Comments

@Link1J
Copy link

Link1J commented May 29, 2020

Version/Branch of Dear ImGui:

Version: 1.76 WIP
Branch: Master and Docking

Back-end/Renderer/Compiler/OS

Back-ends: imgui_impl_glfw.cpp + imgui_impl_opengl3.cpp, imgui_impl_glfw.cpp + imgui_impl_vulkan.cpp, imgui_impl_win32.cpp + imgui_impl_directx11.cpp, Custom
Compiler: MSVC
Operating System: Windows 10

My Issue/Question:

The yellow boxes for drag and drop targets, do not stay within the window they are from. It does not appear to be affected by any chance to the renderer or backend.

Screenshots/Video

Yellow box breaks window bounds 2

Standalone, minimal, complete and verifiable example:
The Demo window works to show this.
Make the Demo window have a width of 93, then use the first drag and drop example with the color edits. That is what was done to get the screen shot.

@Link1J
Copy link
Author

Link1J commented May 31, 2020

I'm pretty sure this is intended behavior.

Last I checked the window elements stay in window. The yellow box does not. Therefor unintended behavior. Note that the yellow box draws on the scrollbar, and the background.

@markitus18
Copy link

Last I checked the window elements stay in window. The yellow box does not. Therefor unintended behavior. Note that the yellow box draws on the scrollbar, and the background.

Ah, yes, of course... I thought you were referring to the tooltip window. Too many hours of debugging today :) Removing my comment to avoid confusion.

@rokups
Copy link
Contributor

rokups commented Jun 1, 2020

Turns out that this behavior is enabled on purpose. This is how it looks without explicitly allowing yellow rectangle to go out of bounds:
image
I have no idea what correct behavior is in this case. We have to wait for a verdict from @ocornut.

@Link1J Link1J closed this as completed Jun 1, 2020
@Link1J Link1J reopened this Jun 1, 2020
@ocornut ocornut added the drag drop drag and drop label Jun 1, 2020
ocornut added a commit that referenced this issue Jun 30, 2021
@ocornut
Copy link
Owner

ocornut commented Jun 30, 2021

Pushed a fix with 4ddb6b4
This intentional (see initial commit 4b94738) but I frankly can't remember nor understand why I thought it was a good idea back then...
Same issue as #4281

@ocornut
Copy link
Owner

ocornut commented Oct 5, 2023

I have reworked this with 085ed7b

Before June 2021
image

June 2021
image

October 2023
image

ocornut added a commit that referenced this issue Nov 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
drag drop drag and drop
Projects
None yet
Development

No branches or pull requests

4 participants