mirror of
https://github.com/ocornut/imgui.git
synced 2026-11-16 19:11:13 +00:00
Custom callback constraints in Constrained Resize example do not work #6210
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#6210
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:
e25e4526cdBranch:
dockingBack-end/Renderer/Compiler/OS
GLFW + GLAD on Linux compiled with GCC 12
Expectation
The Constrained Resize example with the
Custom: Aspect Ratio 16:9should resize and be constrained to16:9Observed
Attempting to resize does not resize at all. None of the custom restrains allow resizing at all.
On the
dockingbranch, with viewports disabled. Docking itself being enabled/disabled makes no difference.Tested breifly on
masteratbfce7750b1, also seems to occur.See attached video
https://user-images.githubusercontent.com/15949431/222254646-45c8fea7-54cb-48dd-a092-a5308dadf711.mp4
Noticed that too, it broke in
2569c64740and it can be restored with this patch (s/CurrentSize/DesiredSize/):However even the old behavior doesn't seem fully right as the 16:9 example can't resize with an horizontal edge and the square example can't be resized down with neither horizontal nor vertical edges. I haven't looked into it further.
@cfillion Thanks for that snippet above, worked alright on
16:9, but for an aspect ratio of9:16(vertically recorded video), it did some odd things without even resizing (looks like one of the dimensions rose quickly and then overflowed).This part alone is what worked for me on
16:9and9:16, not sure why or how, but sometimes math works best when you least understand it 🎉data->DesiredSize.y = data->DesiredSize.x / *reinterpret_cast<float*>(data->UserData);Still shares a similar issue to yours above though -- can't resize from the top and bottom edges.