Fix implementation of tracking rectangles to use the coordinate system

of their views, as they do under Cocoa.


git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@35645 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
wlux 2012-10-06 19:42:56 +00:00
parent 4bc8763f12
commit 4d7ff1de4a
5 changed files with 24 additions and 55 deletions

View file

@ -3448,6 +3448,7 @@ resetCursorRectsForView(NSView *theView)
return;
if (theView->_rFlags.has_trkrects)
{
BOOL isFlipped = [theView isFlipped];
NSArray *tr = theView->_tracking_rects;
unsigned count = [tr count];
@ -3458,8 +3459,11 @@ resetCursorRectsForView(NSView *theView)
{
GSTrackingRect *rects[count];
NSPoint loc = [theEvent locationInWindow];
NSPoint lastPoint = _lastPoint;
unsigned i;
lastPoint = [theView convertPoint: lastPoint fromView: nil];
loc = [theView convertPoint: loc fromView: nil];
[tr getObjects: rects];
for (i = 0; i < count; ++i)
@ -3471,9 +3475,9 @@ resetCursorRectsForView(NSView *theView)
if ([r isValid] == NO)
continue;
/* Check mouse at last point */
last = NSMouseInRect(_lastPoint, r->rectangle, NO);
last = NSMouseInRect(lastPoint, r->rectangle, isFlipped);
/* Check mouse at current point */
now = NSMouseInRect(loc, r->rectangle, NO);
now = NSMouseInRect(loc, r->rectangle, isFlipped);
if ((!last) && (now)) // Mouse entered event
{