Merge pull request #1372 from kjamieson/scroll-fixes

If target view of a drag and drop is a CPTableView, set inset bounds based on the row height of the table
This commit is contained in:
daboe01 authored and GitHub committed 2024-12-30 13:51:00 +01:00
commit 16ae7b7e74
1 file changed
+11 -2
+11 -2
View File
@@ -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))
{