mirror of
https://github.com/ocornut/imgui.git
synced 2026-11-10 19:03:30 +00:00
Multicomponent widgets don't resize smoothly (PushMultiItemsWidths) #7120
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#7120
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?
Version/Branch of Dear ImGui:
Version: v1.90
My Issue/Question:
With 3+ components, the way
PushMultiItemsWidthscomputes the width causes some "wave" when resizing a window. The more components there are, the more noticeable the effect.The issue is that that the width of most components is set to the same value with the last component taking what's left. So in some cases, when the size of the whole widget is changed by one pixel, it can cause that common width to change by one pixel as well. This gets multiplied by the number of component-1. So the last component width will change by component-2 pixels in the other direction
Another issue is that components in one widget don't always align with components in another (see the video, where every component of the 4-component widget should align with every 5th component in the 20-component widget)
Screenshots/Video
In the video, note how the last component sometimes grows (resp. shrinks) as a reduce (resp. expand) the size of the window
https://github.com/ocornut/imgui/assets/1198364/420ab023-ee36-48db-818f-d6844641e99e
The "Original" section is how the ImGui code currently works. The "Fixed" is with a corrected version of the algorithm.
Standalone, minimal, complete and verifiable example: