Skip to content

Commit 58180a4

Browse files
amartya4256HeikoKlare
authored andcommitted
Replaced DPIUtil.get(Native)DeviceZoom calls
This commit replaces DPIUtil.get(Native)DeviceZoom calls for win32 and uses the zoom information available within the controls. contributes to #62 and #127
1 parent 24c8513 commit 58180a4

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ Image getDragSourceImage(DragSourceEvent event) {
147147
data.transparentPixel = shdi.crColorKey << 8;
148148
}
149149
Display display = control.getDisplay();
150-
dragSourceImage = new Image(display, new AutoScaleImageDataProvider(display, data, DPIUtil.getDeviceZoom()));
150+
dragSourceImage = new Image(display, new AutoScaleImageDataProvider(display, data, DPIUtil.getZoomForAutoscaleProperty(control.nativeZoom)));
151151
OS.SelectObject (memHdc, oldMemBitmap);
152152
OS.DeleteDC (memHdc);
153153
OS.DeleteObject (memDib);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ Image getDragSourceImage(DragSourceEvent event) {
146146
data.transparentPixel = shdi.crColorKey << 8;
147147
}
148148
Display display = control.getDisplay ();
149-
dragSourceImage = new Image (display, new AutoScaleImageDataProvider(display, data, DPIUtil.getDeviceZoom()));
149+
dragSourceImage = new Image (display, new AutoScaleImageDataProvider(display, data, DPIUtil.getZoomForAutoscaleProperty(control.nativeZoom)));
150150
OS.SelectObject (memHdc, oldMemBitmap);
151151
OS.DeleteDC (memHdc);
152152
OS.DeleteObject (memDib);

bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Image.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2229,7 +2229,7 @@ public long internal_new_GC (GCData data) {
22292229
data.device = device;
22302230
data.nativeZoom = initialNativeZoom;
22312231
data.image = this;
2232-
data.font = SWTFontProvider.getSystemFont(device, DPIUtil.getNativeDeviceZoom());
2232+
data.font = SWTFontProvider.getSystemFont(device, initialNativeZoom);
22332233
}
22342234
return imageDC;
22352235
}

0 commit comments

Comments
 (0)