Skip to content

Commit e0927d3

Browse files
committed
Set zoom for source image as GCzoom when the GC is not autoscalable
The calculated image zoom for the source image should be the same as the GCzoom(100) when the drawable of GC is not scalable Fixes: #2504
1 parent c6a29a9 commit e0927d3

File tree

1 file changed

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

1 file changed

+3
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1140,6 +1140,9 @@ private int calculateZoomForImage(int gcZoom, int srcWidth, int srcHeight, int d
11401140
// unscaled images can use the GC zoom
11411141
return gcZoom;
11421142
}
1143+
if(!drawable.isAutoScalable()){
1144+
return gcZoom;
1145+
}
11431146

11441147
float imageScaleFactor = 1f * destWidth / srcWidth;
11451148
int imageZoom = Math.round(gcZoom * imageScaleFactor);

0 commit comments

Comments
 (0)