From b349f0a2fb536fd0aef06c4435620524e64c5fdb Mon Sep 17 00:00:00 2001 From: Kevin Jamieson Date: Mon, 3 Oct 2011 22:13:41 -0700 Subject: [PATCH] If target view of a drag is a CPTableView, set inset bounds based on the row height of the table --- AppKit/CPDragServer.j | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/AppKit/CPDragServer.j b/AppKit/CPDragServer.j index bc67ee490..dcaf7c035 100644 --- a/AppKit/CPDragServer.j +++ b/AppKit/CPDragServer.j @@ -261,10 +261,19 @@ var CPDraggingSource_draggedImage_movedTo_ = 1 << 0, { var contentView = [scrollView contentView], bounds = [contentView bounds], - insetBounds = CGRectInset(bounds, 30, 30), eventLocation = [contentView convertPoint:_draggingLocation fromView:nil], deltaX = 0, - deltaY = 0; + deltaY = 0, + insetSize = 30; + + if ([contentView respondsToSelector:@selector(documentView)] && + [[contentView documentView] respondsToSelector:@selector(rowHeight)]) + { + // Adjust inset bounds based on CPTableView row height + insetSize = MAX(insetSize, [[contentView documentView] rowHeight]); + } + + var insetBounds = CGRectInset(bounds, insetSize, insetSize); if (!CGRectContainsPoint(insetBounds, eventLocation)) {