Skip to content

Commit 9b0df54

Browse files
arunjose696HeikoKlare
authored andcommitted
Fix image handle creation to use correct native zoom
In some cases where an image handle is passed to drawImage, the handle was created with nativeZoom passed as Gc::getZoom(), this would cause the font sizes to be wrong when drawing text with an imageGCDrawer. This change ensures that the image handle is created with the correct nativeZoom from GC.
1 parent 65ec239 commit 9b0df54

File tree

1 file changed

+2
-2
lines changed
  • bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1062,7 +1062,7 @@ void apply() {
10621062

10631063
private void drawImageInPixels(Image image, Point location) {
10641064
if (image.isDisposed()) SWT.error(SWT.ERROR_INVALID_ARGUMENT);
1065-
ImageHandle handle = image.getHandle(getZoom(), getZoom());
1065+
ImageHandle handle = image.getHandle(getZoom(), data.nativeZoom);
10661066
drawImage(image, 0, 0, -1, -1, location.x, location.y, -1, -1, true, handle);
10671067
}
10681068
}
@@ -1279,7 +1279,7 @@ private class DrawImageToImageOperation extends ImageOperation {
12791279

12801280
@Override
12811281
void apply() {
1282-
ImageHandle handle = getImage().getHandle(getZoom(), getZoom());
1282+
ImageHandle handle = getImage().getHandle(getZoom(), data.nativeZoom);
12831283
drawImage(getImage(), source.x, source.y, source.width, source.height, destination.x, destination.y, destination.width, destination.height, simple, handle);
12841284
}
12851285
}

0 commit comments

Comments
 (0)