mirror of
https://github.com/macvim-dev/macvim.git
synced 2026-06-07 15:37:14 +02:00
Ensure that vertical scrollbars do not cover the resize corner (Cocoa never lets them do it anyway, but there were drawing artifacts, so now there is an explicit check).
git-svn-id: http://macvim.googlecode.com/svn/trunk@63 96c4425d-ca35-0410-94e5-3396d5c13a8f
This commit is contained in:
+13
-2
@@ -832,6 +832,9 @@ NSMutableArray *buildMenuAddress(NSMenu *menu)
|
||||
|
||||
// HACK! Find the lowest left&right vertical scrollbars, as well as the
|
||||
// leftmost horizontal scrollbar. This hack continues further down.
|
||||
//
|
||||
// TODO! Can there be no more than one horizontal scrollbar? If so, the
|
||||
// code can be simplified.
|
||||
unsigned lowestLeftSbIdx = (unsigned)-1;
|
||||
unsigned lowestRightSbIdx = (unsigned)-1;
|
||||
unsigned leftmostSbIdx = (unsigned)-1;
|
||||
@@ -914,10 +917,18 @@ NSMutableArray *buildMenuAddress(NSMenu *menu)
|
||||
}
|
||||
}
|
||||
|
||||
// Vertical scrollers must not cover the resize box in the
|
||||
// bottom-right corner of the window.
|
||||
if (rect.origin.y < [NSScroller scrollerWidth]) {
|
||||
rect.size.height -= [NSScroller scrollerWidth] - rect.origin.y;
|
||||
rect.origin.y = [NSScroller scrollerWidth];
|
||||
}
|
||||
|
||||
// Make sure scrollbar rect is bounded by the tab view frame.
|
||||
if (rect.origin.y < tabViewFrame.origin.y)
|
||||
if (rect.origin.y < tabViewFrame.origin.y) {
|
||||
rect.size.height -= tabViewFrame.origin.y - rect.origin.y;
|
||||
rect.origin.y = tabViewFrame.origin.y;
|
||||
else if (rect.origin.y > NSMaxY(tabViewFrame))
|
||||
} else if (rect.origin.y > NSMaxY(tabViewFrame))
|
||||
rect.origin.y = NSMaxY(tabViewFrame);
|
||||
if (NSMaxY(rect) > NSMaxY(tabViewFrame))
|
||||
rect.size.height -= NSMaxY(rect) - NSMaxY(tabViewFrame);
|
||||
|
||||
Reference in New Issue
Block a user