mirror of
https://github.com/ocornut/imgui.git
synced 2024-11-27 16:29:02 +08:00
Window: Fixed SetNextWindowSizeConstraints() with non-rounded positions making windows drift. (#2067, #2530)
This commit is contained in:
parent
9c1f02a42c
commit
526e2303bc
@ -68,6 +68,7 @@ Other Changes:
|
||||
highlight from parent menu items earlier than necessary while approaching the child menu.
|
||||
- Window: Close button is horizontally aligned with style.FramePadding.x.
|
||||
- Window: Fixed contents region being off by WindowBorderSize amount on the right when scrollbar is active.
|
||||
- Window: Fixed SetNextWindowSizeConstraints() with non-rounded positions making windows drift. (#2067, 2530)
|
||||
- Popups: Closing a popup restores the focused/nav window in place at the time of the popup opening,
|
||||
instead of restoring the window that was in the window stack at the time of the OpenPopup call. (#2517)
|
||||
Among other things, this allows opening a popup while no window are focused, and pressing Escape to
|
||||
|
@ -4648,6 +4648,8 @@ static ImVec2 CalcSizeAfterConstraint(ImGuiWindow* window, ImVec2 new_size)
|
||||
g.NextWindowData.SizeCallback(&data);
|
||||
new_size = data.DesiredSize;
|
||||
}
|
||||
new_size.x = ImFloor(new_size.x);
|
||||
new_size.y = ImFloor(new_size.y);
|
||||
}
|
||||
|
||||
// Minimum size
|
||||
|
2
imgui.h
2
imgui.h
@ -269,7 +269,7 @@ namespace ImGui
|
||||
// Prefer using SetNextXXX functions (before Begin) rather that SetXXX functions (after Begin).
|
||||
IMGUI_API void SetNextWindowPos(const ImVec2& pos, ImGuiCond cond = 0, const ImVec2& pivot = ImVec2(0,0)); // set next window position. call before Begin(). use pivot=(0.5f,0.5f) to center on given point, etc.
|
||||
IMGUI_API void SetNextWindowSize(const ImVec2& size, ImGuiCond cond = 0); // set next window size. set axis to 0.0f to force an auto-fit on this axis. call before Begin()
|
||||
IMGUI_API void SetNextWindowSizeConstraints(const ImVec2& size_min, const ImVec2& size_max, ImGuiSizeCallback custom_callback = NULL, void* custom_callback_data = NULL); // set next window size limits. use -1,-1 on either X/Y axis to preserve the current size. Use callback to apply non-trivial programmatic constraints.
|
||||
IMGUI_API void SetNextWindowSizeConstraints(const ImVec2& size_min, const ImVec2& size_max, ImGuiSizeCallback custom_callback = NULL, void* custom_callback_data = NULL); // set next window size limits. use -1,-1 on either X/Y axis to preserve the current size. Sizes will be rounded down. Use callback to apply non-trivial programmatic constraints.
|
||||
IMGUI_API void SetNextWindowContentSize(const ImVec2& size); // set next window content size (~ enforce the range of scrollbars). not including window decorations (title bar, menu bar, etc.). set an axis to 0.0f to leave it automatic. call before Begin()
|
||||
IMGUI_API void SetNextWindowCollapsed(bool collapsed, ImGuiCond cond = 0); // set next window collapsed state. call before Begin()
|
||||
IMGUI_API void SetNextWindowFocus(); // set next window to be focused / front-most. call before Begin()
|
||||
|
Loading…
Reference in New Issue
Block a user