Created
June 13, 2009 19:43
-
-
Save cappuccino/129404 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (!_acceptsMouseMovedEvents) | |
return; | |
var hitTestView = [_windowView hitTest:point]; | |
if ([_mouseEnteredStack lastObject] === hitTestView) | |
return; | |
var view = hitTestView, | |
mouseEnteredStack = []; | |
while (view) | |
{ | |
mouseEnteredStack.push(view); | |
view = [view superview]; | |
} | |
var deviation = MIN(_mouseEnteredStack.length, mouseEnteredStack.length); | |
while (deviation--) | |
if (_mouseEnteredStack[deviation] !== mouseEnteredStack[deviation]) | |
break; | |
var index = deviation, | |
count = _mouseEnteredStack.length; | |
if (index < count) | |
{ | |
var event = [CPEvent mouseEventWithType:CPMouseExited location:point | |
modifierFlags:[anEvent modifierFlags] timestamp:[anEvent timestamp] windowNumber:_windowNumber context:nil eventNumber:-1 clickCount:1 pressure:0]; | |
for (; index < count; ++index) | |
[_mouseEnteredStack[index] mouseExited:event]; | |
} | |
index = deviation; | |
count = mouseEnteredStack.length; | |
if (index < count) | |
{ | |
var event = [CPEvent mouseEventWithType:CPMouseEntered location:point | |
modifierFlags:[anEvent modifierFlags] timestamp:[anEvent timestamp] windowNumber:_windowNumber context:nil eventNumber:-1 clickCount:1 pressure:0]; | |
for (; index < count; ++index) | |
[mouseEnteredStack[index] mouseExited:event]; | |
} | |
_mouseEnteredStack = mouseEnteredStack; | |
[hitTestView mouseMoved:anEvent]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment