diff options
author | Veronika Irvine <torres> | 2001-06-09 19:49:21 +0000 |
---|---|---|
committer | Veronika Irvine <torres> | 2001-06-09 19:49:21 +0000 |
commit | 657a5e259cd47a1dafd0ca87bcefe0239cf3293b (patch) | |
tree | fcb87a801bf823635275591418a02f87557a2861 | |
parent | a7e521193afecefe73a90cea527dc8f5587296c9 (diff) | |
download | eclipse.platform.swt-657a5e259cd47a1dafd0ca87bcefe0239cf3293b.tar.gz eclipse.platform.swt-657a5e259cd47a1dafd0ca87bcefe0239cf3293b.tar.xz eclipse.platform.swt-657a5e259cd47a1dafd0ca87bcefe0239cf3293b.zip |
fix for scrolling issue
-rwxr-xr-x | bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/win32/org/eclipse/swt/dnd/TreeDragUnderEffect.java | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/win32/org/eclipse/swt/dnd/TreeDragUnderEffect.java b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/win32/org/eclipse/swt/dnd/TreeDragUnderEffect.java index 6ef3a4e08c..431a68dc7e 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/win32/org/eclipse/swt/dnd/TreeDragUnderEffect.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/win32/org/eclipse/swt/dnd/TreeDragUnderEffect.java @@ -46,16 +46,35 @@ void show(int effect, int x, int y) { private TreeItem findItem(int x , int y){
Point coordinates = new Point(x, y);
coordinates = tree.toControl(coordinates);
+ Rectangle area = tree.getClientArea();
+ if (!area.contains(coordinates)) return null;
+
TreeItem item = tree.getItem(coordinates);
if (item != null) return item;
- Rectangle area = tree.getClientArea();
+ // Scan across the width of the tree.
for (int x1 = area.x; x1 < area.x + area.width; x1++) {
- coordinates = new Point(x1, y);
- coordinates = tree.toControl(coordinates);
+ coordinates = new Point(x1, coordinates.y);
item = tree.getItem(coordinates);
if (item != null) return item;
}
+ // Check if we are just below the last item of the tree
+ coordinates = new Point(x, y);
+ coordinates = tree.toControl(coordinates);
+ if (coordinates.y > area.y + area.height - tree.getItemHeight()) {;
+ int y1 = area.y + area.height - tree.getItemHeight();
+ coordinates = new Point(coordinates.x, y1);
+
+ item = tree.getItem(coordinates);
+ if (item != null) return item;
+
+ // Scan across the width of the tree just above the bottom..
+ for (int x1 = area.x; x1 < area.x + area.width; x1++) {
+ coordinates = new Point(x1, y1);
+ item = tree.getItem(coordinates);
+ if (item != null) return item;
+ }
+ }
return null;
}
private void setDragUnderEffect(int effect, TreeItem item) {
|