From 9eff0ee75520a30feb44040e43b805e16bf15a46 Mon Sep 17 00:00:00 2001 From: Vassiliy Kudryashov Date: Tue, 31 Jul 2012 16:25:20 +0400 Subject: [PATCH] Usability improvement: cursor doesn't have to be exactly inside node for highlighting and dropping --- .../intellij/ide/projectView/impl/ProjectViewDropTarget.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/ide/projectView/impl/ProjectViewDropTarget.java b/platform/lang-impl/src/com/intellij/ide/projectView/impl/ProjectViewDropTarget.java index dc79ff21bf73..e47ca4e2b21a 100644 --- a/platform/lang-impl/src/com/intellij/ide/projectView/impl/ProjectViewDropTarget.java +++ b/platform/lang-impl/src/com/intellij/ide/projectView/impl/ProjectViewDropTarget.java @@ -105,7 +105,7 @@ class ProjectViewDropTarget implements DnDNativeTarget { } } - final Rectangle pathBounds = myTree.getPathBounds(myTree.getPathForLocation(point.x, point.y)); + final Rectangle pathBounds = myTree.getPathBounds(myTree.getClosestPathForLocation(point.x, point.y)); event.setHighlighting(new RelativeRectangle(myTree, pathBounds), DnDEvent.DropTargetHighlightingType.RECTANGLE); event.setDropPossible(true); return false; @@ -160,7 +160,7 @@ class ProjectViewDropTarget implements DnDNativeTarget { @Nullable private TreeNode getTargetNode(final Point location) { - final TreePath path = myTree.getPathForLocation(location.x, location.y); + final TreePath path = myTree.getClosestPathForLocation(location.x, location.y); return path == null ? null : (TreeNode)path.getLastPathComponent(); }