Skip to content

Commit e2ac7f1

Browse files
arunjose696HeikoKlare
authored andcommitted
Revert usage of getZoom() when calculating TextExtent
This issue reverts the behavior of GC::textExtent to use the GC::getZoom() instead of the zoom from the font as this results in a regression. Fixes #2361
1 parent 540a1d7 commit e2ac7f1

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
@@ -5725,7 +5725,7 @@ void apply() {
57255725
*/
57265726
public Point stringExtent (String string) {
57275727
if (string == null) SWT.error (SWT.ERROR_NULL_ARGUMENT);
5728-
return Win32DPIUtils.pixelToPoint(drawable, stringExtentInPixels(string), data.font.zoom);
5728+
return Win32DPIUtils.pixelToPoint(drawable, stringExtentInPixels(string), getZoom());
57295729
}
57305730

57315731
Point stringExtentInPixels (String string) {
@@ -5805,7 +5805,7 @@ public Point textExtent (String string) {
58055805
* </ul>
58065806
*/
58075807
public Point textExtent (String string, int flags) {
5808-
return Win32DPIUtils.pixelToPoint(drawable, textExtentInPixels(string, flags), data.font.zoom);
5808+
return Win32DPIUtils.pixelToPoint(drawable, textExtentInPixels(string, flags), getZoom());
58095809
}
58105810

58115811
Point textExtentInPixels(String string, int flags) {

0 commit comments

Comments
 (0)