mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-16 18:12:10 +00:00
Fix-position tooltip should also be clamped inside render area
This commit is contained in:
@@ -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)
|
||||
window->Pos = FindBestWindowPosForPopup(window);
|
||||
// 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.
|
||||
|
||||
Reference in New Issue
Block a user