diff --git a/core/src/processing/opengl/PGraphicsOpenGL.java b/core/src/processing/opengl/PGraphicsOpenGL.java index 9ecf2fadc..7d3949df5 100644 --- a/core/src/processing/opengl/PGraphicsOpenGL.java +++ b/core/src/processing/opengl/PGraphicsOpenGL.java @@ -5479,7 +5479,7 @@ public class PGraphicsOpenGL extends PGraphics { endPixelsOp(); } else { // We only need to copy the pixels to the back texture where we are - // currently drawing to. Because the texture is invertex along Y, we + // currently drawing to. Because the texture is inverted along Y, we // need to reflect that in the vertical arguments. pgl.copyToTexture(texture.glTarget, texture.glFormat, texture.glName, x, pixelHeight - (y + h), w, h, nativePixelBuffer); diff --git a/core/src/processing/opengl/Texture.java b/core/src/processing/opengl/Texture.java index c2f75f3f2..4cc51ba64 100644 --- a/core/src/processing/opengl/Texture.java +++ b/core/src/processing/opengl/Texture.java @@ -340,6 +340,8 @@ public class Texture implements PConstants { loadPixels(w * h); convertToRGBA(pixels, format, w, h); + if (invertedX) flipArrayOnX(rgbaPixels, 1); + if (invertedY) flipArrayOnY(rgbaPixels, 1); updatePixelBuffer(rgbaPixels); pgl.texSubImage2D(glTarget, 0, x, y, w, h, PGL.RGBA, PGL.UNSIGNED_BYTE, pixelBuffer);