* Source/GSThemeDrawing.m (drawScrollViewRect:inView:): minor variables fixes for

variables usage.
This commit is contained in:
Sergii Stoian 2019-12-17 19:50:45 +02:00
parent 7c6a22d174
commit 3086184b2b

View file

@ -2644,47 +2644,47 @@ typedef enum {
NSScroller *vertScroller = [scrollView verticalScroller]; NSScroller *vertScroller = [scrollView verticalScroller];
NSScroller *horizScroller = [scrollView horizontalScroller]; NSScroller *horizScroller = [scrollView horizontalScroller];
CGFloat scrollerWidth = [NSScroller scrollerWidth]; CGFloat scrollerWidth = [NSScroller scrollerWidth];
CGFloat scrollerHeight; NSRect scrollerFrame;
[color set]; [color set];
if ([scrollView hasVerticalScroller]) if ([scrollView hasVerticalScroller])
{ {
NSInterfaceStyle style; NSInterfaceStyle style;
CGFloat xpos = [vertScroller frame].origin.x; CGFloat xpos;
scrollerHeight = [vertScroller frame].size.height; scrollerFrame = [vertScroller frame];
style = NSInterfaceStyleForKey(@"NSScrollViewInterfaceStyle", nil); style = NSInterfaceStyleForKey(@"NSScrollViewInterfaceStyle", nil);
if (style == NSMacintoshInterfaceStyle if (style == NSMacintoshInterfaceStyle
|| style == NSWindows95InterfaceStyle) || style == NSWindows95InterfaceStyle)
{ {
xpos -= 1.0; xpos = scrollerFrame.origin.x - 1.0;
} }
else else
{ {
xpos += scrollerWidth; xpos = scrollerFrame.origin.x + scrollerWidth;
} }
NSRectFill(NSMakeRect(xpos, [vertScroller frame].origin.y, NSRectFill(NSMakeRect(xpos, scrollerFrame.origin.y,
1.0, scrollerHeight)); 1.0, scrollerFrame.size.height));
} }
if ([scrollView hasHorizontalScroller]) if ([scrollView hasHorizontalScroller])
{ {
CGFloat ypos = [horizScroller frame].origin.y; CGFloat ypos;
scrollerHeight = [horizScroller frame].size.width; scrollerFrame = [horizScroller frame];
if ([scrollView isFlipped]) if ([scrollView isFlipped])
{ {
ypos -= 1.0; ypos = scrollerFrame.origin.y - 1.0;
} }
else else
{ {
ypos += scrollerWidth + 1.0; ypos = scrollerFrame.origin.y + scrollerWidth + 1.0;
} }
NSRectFill(NSMakeRect([horizScroller frame].origin.x, ypos, NSRectFill(NSMakeRect([horizScroller frame].origin.x, ypos,
scrollerHeight, 1.0)); scrollerFrame.size.width, 1.0));
} }
} }
} }