Merge pull request #40 from trunkmaster/master

Scroller border drawing fix in NSScrollView
This commit is contained in:
Fred Kiefer 2019-12-17 13:23:45 +01:00 committed by GitHub
commit d6ef33d805
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 4 deletions

View file

@ -1,3 +1,9 @@
2019-12-17 Sergii Stoian <stoyan255@gmail.com>
* Source/GSThemeDrawing.m (drawScrollViewRect:inView:): fixed scroller
border positionning and length - do not overlap border if any.
Use [self sizeForBorderType: borderType] to determine border width.
2019-12-12 Sergii Stoian <stoyan255@gmail.com>
* Source/NSFont.m (smallSystemFontSize): return 10 as default value.

View file

@ -2646,6 +2646,7 @@ typedef enum {
NSScroller *vertScroller = [scrollView verticalScroller];
NSScroller *horizScroller = [scrollView horizontalScroller];
CGFloat scrollerWidth = [NSScroller scrollerWidth];
CGFloat borderWidth = [self sizeForBorderType: borderType].width;
[color set];
@ -2665,8 +2666,8 @@ typedef enum {
{
xpos = [vertScroller frame].origin.x + scrollerWidth;
}
NSRectFill(NSMakeRect(xpos, [vertScroller frame].origin.y - 1.0,
1.0, scrollerHeight + 1.0));
NSRectFill(NSMakeRect(xpos, [vertScroller frame].origin.y,
1.0, scrollerHeight - (borderWidth * 2)));
}
if ([scrollView hasHorizontalScroller])
@ -2688,8 +2689,8 @@ typedef enum {
{
ypos = scrollerY + scrollerWidth + 1.0;
}
NSRectFill(NSMakeRect([horizScroller frame].origin.x - 1.0, ypos,
scrollerLength + 1.0, 1.0));
NSRectFill(NSMakeRect([horizScroller frame].origin.x, ypos,
scrollerLength - (borderWidth * 2), 1.0));
}
}
}