Export graphics: fix flip / mirror after 8565ff28 96/16096/1
Clément DAVID [Thu, 5 Mar 2015 08:41:27 +0000 (09:41 +0100)]
Copy 'n Paste the plot image flip / mirror it after the JoGL upgrade.

Change-Id: I34aea56136c7eefcb54a2d738f8a0b6777c0b12f

scilab/modules/scirenderer/src/org/scilab/forge/scirenderer/implementation/jogl/JoGLCanvas.java

index 8752460..169067f 100644 (file)
@@ -247,7 +247,7 @@ public final class JoGLCanvas implements Canvas, GLEventListener {
         if (SwingUtilities.isEventDispatchThread()) {
             context.makeCurrent();
             AWTGLReadBufferUtil buffer = new AWTGLReadBufferUtil(GLProfile.getDefault(), true);
-            image[0] = buffer.readPixelsToBufferedImage(getGl(), 0, 0, autoDrawable.getSurfaceWidth(), autoDrawable.getSurfaceHeight(), false);
+            image[0] = buffer.readPixelsToBufferedImage(getGl(), 0, 0, autoDrawable.getSurfaceWidth(), autoDrawable.getSurfaceHeight(), true);
             context.release();
         } else {
             try {
@@ -255,7 +255,7 @@ public final class JoGLCanvas implements Canvas, GLEventListener {
                     public void run() {
                         context.makeCurrent();
                         AWTGLReadBufferUtil buffer = new AWTGLReadBufferUtil(GLProfile.getDefault(), true);
-                        image[0] = buffer.readPixelsToBufferedImage(getGl(), 0, 0, autoDrawable.getSurfaceWidth(), autoDrawable.getSurfaceHeight(), false);
+                        image[0] = buffer.readPixelsToBufferedImage(getGl(), 0, 0, autoDrawable.getSurfaceWidth(), autoDrawable.getSurfaceHeight(), true);
                         context.release();
                     }
                 });