Skip to content

Commit e0f13e7

Browse files
ShahzaibIbrahimHeikoKlare
authored andcommitted
Incorrect Zoom Level Applied When Dragging
When dragging and dropping a file from the Package Explorer or a field/method from the Outline view, the dragged item appears at an incorrect zoom level. Thats because the zoom for DragSource was not updated on zoom change and we use that zoom in DragListener to update the size of the imageList.
1 parent 8519c60 commit e0f13e7

File tree

1 file changed

+6
-0
lines changed
  • bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/win32/org/eclipse/swt/dnd

1 file changed

+6
-0
lines changed

bundles/org.eclipse.swt/Eclipse SWT Drag and Drop/win32/org/eclipse/swt/dnd/DragSource.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,9 +380,15 @@ public DragSource(Control control, int style) {
380380
DragSource.this.drag(event);
381381
}
382382
}
383+
if (event.type == SWT.ZoomChanged) {
384+
if (!DragSource.this.isDisposed()) {
385+
this.nativeZoom = event.detail;
386+
}
387+
}
383388
};
384389
control.addListener(SWT.Dispose, controlListener);
385390
control.addListener(SWT.DragDetect, controlListener);
391+
control.addListener(SWT.ZoomChanged, controlListener);
386392

387393
this.addListener(SWT.Dispose, e -> DragSource.this.onDispose());
388394

0 commit comments

Comments
 (0)