Skip to content

Commit f5d1852

Browse files
cfillionocornut
authored andcommitted
Viewports: fixed outer-right edge of MenuBar clipping rectangle off by one when window is located on a monitor with negative coordinates. (#6861, #2884)
1 parent 2f2d507 commit f5d1852

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

Diff for: docs/CHANGELOG.txt

+2
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ Docking+Viewports Branch:
9393

9494
- Docking: when io.ConfigDockingWithShift is enabled, fixed help tooltip erroneously
9595
reading SetNextWindowXXX() data. (#6709, #4643, #7491) [@ocornut, @cfillion]
96+
- Viewports: fixed outer-right edge of MenuBar clipping rectangle off by one when window
97+
is located on a monitor with negative coordinates. (#6861, #2884) [@cfillion]
9698
- Backends: Vulkan: create a custom pipeline for secondary viewports. Fixes issues
9799
when user created main viewport uses a different renderpass. (#6325, #6305, #7398,
98100
#3459, #3253, #3522) [@skaman, @FunMiles]

Diff for: imgui_widgets.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -7309,7 +7309,7 @@ bool ImGui::BeginMenuBar()
73097309
// We don't clip with current window clipping rectangle as it is already set to the area below. However we clip with window full rect.
73107310
// We remove 1 worth of rounding to Max.x to that text in long menus and small windows don't tend to display over the lower-right rounded area, which looks particularly glitchy.
73117311
ImRect bar_rect = window->MenuBarRect();
7312-
ImRect clip_rect(IM_ROUND(bar_rect.Min.x + window->WindowBorderSize), IM_ROUND(bar_rect.Min.y + window->WindowBorderSize), IM_ROUND(ImMax(bar_rect.Min.x, bar_rect.Max.x - ImMax(window->WindowRounding, window->WindowBorderSize))), IM_ROUND(bar_rect.Max.y));
7312+
ImRect clip_rect(ImFloor(bar_rect.Min.x + window->WindowBorderSize), ImFloor(bar_rect.Min.y + window->WindowBorderSize), ImFloor(ImMax(bar_rect.Min.x, bar_rect.Max.x - ImMax(window->WindowRounding, window->WindowBorderSize))), ImFloor(bar_rect.Max.y));
73137313
clip_rect.ClipWith(window->OuterRectClipped);
73147314
PushClipRect(clip_rect.Min, clip_rect.Max, false);
73157315

0 commit comments

Comments
 (0)