mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
invert rgbaPixels, fixes #5013
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user