mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-23 20:01:11 +00:00
Reduce repetition of code
This commit is contained in:
parent
f57e5184c3
commit
57a8720cd8
1 changed files with 9 additions and 7 deletions
|
@ -893,22 +893,24 @@
|
|||
// make smaller so that it does not touch frame
|
||||
NSBezierPath *oval;
|
||||
NSRect rect = NSZeroRect;
|
||||
CGFloat w = frame.size.width / 2;
|
||||
CGFloat w = (frame.size.width / 2) - 2;
|
||||
CGFloat h = frame.size.height - 5;
|
||||
CGFloat y = frame.origin.y + 2;
|
||||
|
||||
[backgroundColor set];
|
||||
if(value == NSControlStateValueOff)
|
||||
{
|
||||
rect = NSMakeRect(frame.origin.x + 4,
|
||||
frame.origin.y + 2,
|
||||
w - 2,
|
||||
frame.size.height - 5);
|
||||
y,
|
||||
w,
|
||||
h);
|
||||
}
|
||||
else
|
||||
{
|
||||
rect = NSMakeRect(frame.origin.x + ((frame.size.width - w) - 2),
|
||||
frame.origin.y + 2,
|
||||
w - 2,
|
||||
frame.size.height - 5);
|
||||
y,
|
||||
w,
|
||||
h);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue