Skip to content

Commit

Permalink
Replaced DPIUtil.get(Native)DeviceZoom calls
Browse files Browse the repository at this point in the history
This commit replaces DPIUtil.get(Native)DeviceZoom calls for win32 and
uses the zoom information available within the controls.

contributes to #62 and #127
  • Loading branch information
amartya4256 authored and HeikoKlare committed Jul 29, 2024
1 parent 24c8513 commit 58180a4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ Image getDragSourceImage(DragSourceEvent event) {
data.transparentPixel = shdi.crColorKey << 8;
}
Display display = control.getDisplay();
dragSourceImage = new Image(display, new AutoScaleImageDataProvider(display, data, DPIUtil.getDeviceZoom()));
dragSourceImage = new Image(display, new AutoScaleImageDataProvider(display, data, DPIUtil.getZoomForAutoscaleProperty(control.nativeZoom)));
OS.SelectObject (memHdc, oldMemBitmap);
OS.DeleteDC (memHdc);
OS.DeleteObject (memDib);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ Image getDragSourceImage(DragSourceEvent event) {
data.transparentPixel = shdi.crColorKey << 8;
}
Display display = control.getDisplay ();
dragSourceImage = new Image (display, new AutoScaleImageDataProvider(display, data, DPIUtil.getDeviceZoom()));
dragSourceImage = new Image (display, new AutoScaleImageDataProvider(display, data, DPIUtil.getZoomForAutoscaleProperty(control.nativeZoom)));
OS.SelectObject (memHdc, oldMemBitmap);
OS.DeleteDC (memHdc);
OS.DeleteObject (memDib);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2229,7 +2229,7 @@ public long internal_new_GC (GCData data) {
data.device = device;
data.nativeZoom = initialNativeZoom;
data.image = this;
data.font = SWTFontProvider.getSystemFont(device, DPIUtil.getNativeDeviceZoom());
data.font = SWTFontProvider.getSystemFont(device, initialNativeZoom);
}
return imageDC;
}
Expand Down

0 comments on commit 58180a4

Please sign in to comment.