mirror of
https://github.com/ocornut/imgui.git
synced 2026-11-14 19:04:44 +00:00
Possible error in calculating #682
Labels
No labels
accidentally closed
android
backends
bug
building
clipper
coloredit
color spaces
cplusplus
data types
demo
disabled
doc
docking
dpi
drag drop
drawing/drawlist
dropped
dx12
enhancement
focus
font/text
gallery
help wanted
idle/power saving
ime
in progress
inputs
inputtext
internals
label/id and id stack
language bindings
layout
linux/bsd
menus
multi-contexts
multi-threading
multi-viewports
nav
news/info
opengl
optimization
osx/ios
overlap
plot/graph
popups
question
scrolling
selection
settings
sliders/drags
style
tables/columns
tabs
test wanted
tools
tooltips
tree
tricks & tips
useful widgets
vulkan
web
window pos/depth
window sizing
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
ocornut/imgui#682
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Looking near line 4206 in imgui.cpp:
ocornut/imgui@45dacbf084/imgui.cpp (L4206)It appears to me like you assign to
Min.Xtwice in a row, which seems to me like the second line perhaps should've been assigned toMin.Yinstead (similar to howMax.Xand `Max.Y are assigned to immediately after.)However, I'm not entirely sure. I stumbled upon this while trying to figure out a problem with a run-away scrollbar (it keeps growing downward by 4 pixels every frame) ever since I integrated Paniq's imgui_dock code. Changing that second
Min.XtoMin.Ydidn't do anything to fix that though. So I'll keep digging, but in the meantime I figured I'd at least ask if that code is as intended.Great project, thank you so much Ocornut!
OUCH, totally a bug I introduced a few commits ago.
Interestingly it wasn't having much effect because core imgui doesn't use the Y value for this field, BUT the user could in theory retrieve it (even if it's rare).
Thanks!
Let me know if you fnid more about your other issue.
Let me know if instead of continuing here you'd rather I open up a new issue, but I'm a bit stumped on this vertical window growing thing. I've trimmed it down to three windows being created (the outer default Debug one, and then one window that Paniq creates in BeginWorkspace, and then one docked window that I create in there using BeginDock). I've put no widgets on any of it. The outermost window is created as follows (I took this from Paniq's code):
To be clear, I'm not expecting you to debug my problems. Nor do I assume you know much of Paniq's code (though I did see your involvement in the Dock Layout discussion, leaving me with some small amount of hope that you are somewhat aware of it).
I started stepping through the debugger, and I narrowed things down to a narrow place where before and after a vertical size.y value keeps increasing by 4. From there, I figured I trace back where that increment of 4 comes from. I used data-breakpoints to see whom is writing to what, which led me to some kind of circular interplay between the window
size.yand the windowcontent_avail.y.In
ImGui::BeginChildnear line 3550, the code updatessize.yusingcontent_avail.ylike so:And indeed, every frame tick the value of
content_avail.yis 4 greater. So working back, I see thatcontent_avail.ycomes fromContentsRegionRect.Max, then putting a data breakpoint on that, leads me to it being updated inImGui::Beginnear line 4215 in this code:Most of the values in that statement are zero. The thing that is increasing by 4 every frame is, guess what... (suspense 😄...),
window->size.y. But that was precisely the thing that got updated byContentsRegionRect.Maxpreviously.So I'm not clear on the relationship between these two variables. Perhaps one is referring to the parent window and the other to the child window. Or do they belong to the same window and is one from the previous frame?
Again, I'm not really expecting you to read this and have a solution for me. I'm just writing this down in the hope it may clear my own head and make it obvious what I'm doing wrong. If you have any thoughts at all, that'd be great.
If I'm unable to resolve this I'll probably try to make a minimal reproduction and fire it your way. Then I'll probably discover the problem is either in Paniq's code (not likely), or my own code (very likely).
Thanks again,
Jaap Suter
Please post as new issue with nice subject line, thanks!
Sent from my fax machine
OK this is all a little confusing but I would eventually look. If you can expand the workspacing/dock code into a ImGui-only repro it would probably make me look faster but otherwise I will dig in it.
Screenshots/video would also help just to grasp the situation. Normally I'd look faster but this week has and is going to be very tough/busy as I am announcing my game :)
Are you sure that the 4.0f comes from that hardcoded value (which is an arbitrary minimum size for a child window because 0.0f causes problem)? And not from the 4.0 of
style.ItemSpacing.y? Which you can change to another value to identify the cause.