mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-06-01 13:21:56 +00:00
Reduce flicker by only highlighting when needed
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@6318 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
5628505c5a
commit
f4ae81a101
2 changed files with 25 additions and 6 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2000-03-18 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
|
* Source/NSSplitView.m: ([-mouseDown:]) only highlight/unhighlight
|
||||||
|
divider when actually necessary.
|
||||||
|
|
||||||
Fri Mar 17 23:33:40 2000 Nicola Pero <n.pero@mi.flashnet.it>
|
Fri Mar 17 23:33:40 2000 Nicola Pero <n.pero@mi.flashnet.it>
|
||||||
|
|
||||||
First alpha implementation of NSTableView. Mouse interaction
|
First alpha implementation of NSTableView. Mouse interaction
|
||||||
|
|
|
@ -68,6 +68,7 @@
|
||||||
{
|
{
|
||||||
NSApplication *app = [NSApplication sharedApplication];
|
NSApplication *app = [NSApplication sharedApplication];
|
||||||
static NSRect oldRect; //only one can be dragged at a time
|
static NSRect oldRect; //only one can be dragged at a time
|
||||||
|
static BOOL lit = NO;
|
||||||
NSPoint p;
|
NSPoint p;
|
||||||
NSEvent *e;
|
NSEvent *e;
|
||||||
NSRect r, r1, bigRect, vis;
|
NSRect r, r1, bigRect, vis;
|
||||||
|
@ -245,18 +246,31 @@
|
||||||
r.origin.x = p.x - (divHorizontal/2.);
|
r.origin.x = p.x - (divHorizontal/2.);
|
||||||
r.origin.y = NSMinY(vis);
|
r.origin.y = NSMinY(vis);
|
||||||
}
|
}
|
||||||
NSDebugLog(@"drawing divider at x: %d, y: %d, w: %d, h: %d\n",
|
if (NSEqualRects(r, oldRect) == NO)
|
||||||
(int)NSMinX(r),(int)NSMinY(r),(int)NSWidth(r),
|
{
|
||||||
(int)NSHeight(r));
|
NSDebugLog(@"drawing divider at x: %d, y: %d, w: %d, h: %d\n",
|
||||||
[_dividerColor set];
|
(int)NSMinX(r), (int)NSMinY(r), (int)NSWidth(r), (int)NSHeight(r));
|
||||||
NSHighlightRect(r);
|
[_dividerColor set];
|
||||||
oldRect = r;
|
if (lit == YES)
|
||||||
|
{
|
||||||
|
NSHighlightRect(oldRect);
|
||||||
|
lit = NO;
|
||||||
|
}
|
||||||
|
NSHighlightRect(r);
|
||||||
|
lit = YES;
|
||||||
|
oldRect = r;
|
||||||
|
}
|
||||||
e = [app nextEventMatchingMask: eventMask
|
e = [app nextEventMatchingMask: eventMask
|
||||||
untilDate: farAway
|
untilDate: farAway
|
||||||
inMode: NSEventTrackingRunLoopMode
|
inMode: NSEventTrackingRunLoopMode
|
||||||
dequeue: YES];
|
dequeue: YES];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (lit == YES)
|
||||||
|
{
|
||||||
[_dividerColor set];
|
[_dividerColor set];
|
||||||
NSHighlightRect(oldRect);
|
NSHighlightRect(oldRect);
|
||||||
|
lit = NO;
|
||||||
}
|
}
|
||||||
|
|
||||||
[self unlockFocus];
|
[self unlockFocus];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue