File openjfx-icedtea8.patch of Package openjfx8

--- rt-8u202-b07/modules/swing/src/main/java/javafx/embed/swing/JFXPanel.java	2018-12-10 17:30:22.000000000 +0100
+++ rt-8u202-b07/modules/swing/src/main/java/javafx/embed/swing/JFXPanel.java	2020-01-27 08:49:05.044305605 +0100
@@ -80,6 +80,7 @@
 import sun.awt.AppContext;
 import sun.awt.CausedFocusEvent;
 import sun.awt.SunToolkit;
+import sun.java2d.SurfaceData;
 import sun.java2d.SunGraphics2D;
 import sun.util.logging.PlatformLogger;
 import sun.util.logging.PlatformLogger.Level;
@@ -682,6 +683,21 @@
     }
 
 
+    private int getDefaultScale(SurfaceData surfaceData) {
+        double scale = 1;
+        try {
+            Method meth = SurfaceData.class.getMethod("getDefaultScaleX");
+            scale = (Double)meth.invoke(surfaceData);
+        } catch (Exception e) {
+            try {
+                Method meth = SurfaceData.class.getMethod("getDefaultScale");
+                scale = (Double)meth.invoke(surfaceData);
+            } catch (Exception ex) {
+            }
+        }
+        return (int)Math.round(scale);
+    }
+
     /**
      * Overrides the {@link javax.swing.JComponent#paintComponent(Graphics)}
      * method to paint the content of the JavaFX scene attached to this
@@ -720,7 +736,7 @@
 
             int newScaleFactor = scaleFactor;
             if (g instanceof SunGraphics2D) {
-                newScaleFactor = ((SunGraphics2D)g).surfaceData.getDefaultScale();
+                newScaleFactor = getDefaultScale(((SunGraphics2D)g).surfaceData);
             }
             if (scaleFactor != newScaleFactor) {
                 resizePixelBuffer(newScaleFactor);
openSUSE Build Service is sponsored by