mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-10-28 19:08:50 +00:00
Fix for drag and drop being broken.
Reviewed by me.
This commit is contained in:
1 parent
4ffed5edf2
commit
9ce20d50ac
2 files changed
+8
-12
No files matched your search
@@ -25,6 +25,8 @@
|
||||
@import <AppKit/CPPasteboard.j>
|
||||
@import <AppKit/CPImageView.j>
|
||||
|
||||
#import "CoreGraphics/CGGeometry.h"
|
||||
|
||||
|
||||
#define DRAGGING_WINDOW(anObject) ([anObject isKindOfClass:[CPWindow class]] ? anObject : [anObject window])
|
||||
|
||||
@@ -289,13 +291,14 @@ var CPDragServerUpdateDragging = function(anEvent)
|
||||
@implementation CPWindow (CPDraggingAdditions)
|
||||
|
||||
/* @ignore */
|
||||
- (id)_dragHitTest:(CPPoint)aPoint pasteboard:(CPPasteboard)aPasteboard
|
||||
- (id)_dragHitTest:(CGPoint)aPoint pasteboard:(CPPasteboard)aPasteboard
|
||||
{
|
||||
if (![self containsPoint:aPoint])
|
||||
return nil;
|
||||
|
||||
var hitView = [_windowView hitTest:aPoint];
|
||||
|
||||
|
||||
var adjustedPoint = _CGPointMake(aPoint.x - _CGRectGetMinX(_frame), aPoint.y - _CGRectGetMinY(_frame)),
|
||||
hitView = [_windowView hitTest:adjustedPoint];
|
||||
|
||||
while (hitView && ![aPasteboard availableTypeFromArray:[hitView registeredDraggedTypes]])
|
||||
hitView = [hitView superview];
|
||||
|
||||
|
||||
@@ -316,14 +316,7 @@ var CPDOMWindowGetFrame,
|
||||
var theWindow = windows[windowCount];
|
||||
|
||||
if ([theWindow containsPoint:aPoint])
|
||||
{
|
||||
var object = [theWindow _dragHitTest:aPoint pasteboard:aPasteboard];
|
||||
|
||||
if (object)
|
||||
return object;
|
||||
else
|
||||
return nil;
|
||||
}
|
||||
return [theWindow _dragHitTest:aPoint pasteboard:aPasteboard];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user