Skip to content

Commit

Permalink
GC Data image scaling Bugfix
Browse files Browse the repository at this point in the history
This commit fixes the image scaling bug in GC data. The image was scaled
with the native zoom of the GC Data instead of the zoom. This leads to
the the problem of no image drawn but just a white background. The image
is only visible when the zoom and nativeZoom are the same. This behavior
can be seen if the IDE is started at i.e. 125% zoom level on the default
monitor. Hence, in this case the zoom is set to 100 and nativeZoom is
125. And due to wrong scaling, the lineNumberRulerColumn and minimize
and maximize button images are not visible but rather just a white
background is visible. This fix provides the right scaling to the
image in the GC Data using the zoom but not the nativeZoom level
as per the standard.

Contributes to #62 and #127
  • Loading branch information
amartya4256 authored and fedejeanne committed Jun 26, 2024
1 parent 97a4865 commit bd223bb
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3932,7 +3932,7 @@ void init(Drawable drawable, GCData data, long hDC) {
}
Image image = data.image;
if (image != null) {
data.hNullBitmap = OS.SelectObject(hDC, Image.win32_getHandle(image, data.nativeZoom));
data.hNullBitmap = OS.SelectObject(hDC, Image.win32_getHandle(image, DPIUtil.getZoomForAutoscaleProperty(data.nativeZoom)));
image.memGC = this;
}
int layout = data.layout;
Expand Down

0 comments on commit bd223bb

Please sign in to comment.