mirror of
https://git.mirrors.martin98.com/https://github.com/SoftFever/OrcaSlicer.git
synced 2025-08-14 15:35:54 +08:00
Fix-position tooltip should also be clamped inside render area
This commit is contained in:
parent
c31e1f5229
commit
d25780ae4a
@ -6046,8 +6046,18 @@ bool ImGui::Begin(const char* name, bool* p_open, ImGuiWindowFlags flags)
|
||||
window->Pos = FindBestWindowPosForPopup(window);
|
||||
else if ((flags & ImGuiWindowFlags_Popup) != 0 && !window_pos_set_by_api && window_just_appearing_after_hidden_for_resize)
|
||||
window->Pos = FindBestWindowPosForPopup(window);
|
||||
else if ((flags & ImGuiWindowFlags_Tooltip) != 0 && !window_pos_set_by_api && !window_is_child_tooltip)
|
||||
// Orca: Allow fixed tooltip pos while still being clamped inside the render area
|
||||
else if ((flags & ImGuiWindowFlags_Tooltip) != 0 && !window_is_child_tooltip) {
|
||||
if (window_pos_set_by_api) {
|
||||
// Hack: add ImGuiWindowFlags_Popup so it does not follow cursor
|
||||
ImGuiWindowFlags old_flags = window->Flags;
|
||||
window->Flags |= ImGuiWindowFlags_Popup;
|
||||
window->Pos = FindBestWindowPosForPopup(window);
|
||||
window->Flags = old_flags;
|
||||
} else {
|
||||
window->Pos = FindBestWindowPosForPopup(window);
|
||||
}
|
||||
}
|
||||
|
||||
// Calculate the range of allowed position for that window (to be movable and visible past safe area padding)
|
||||
// When clamping to stay visible, we will enforce that window->Pos stays inside of visibility_rect.
|
||||
|
Loading…
x
Reference in New Issue
Block a user