From 9190943bda7fde83f9cef1844798e5a1b4ec0dd1 Mon Sep 17 00:00:00 2001 From: Jim Schmitz Date: Fri, 31 Jul 2026 11:16:27 -0400 Subject: [PATCH] fix #1520 --- core/src/processing/opengl/PGraphicsOpenGL.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/src/processing/opengl/PGraphicsOpenGL.java b/core/src/processing/opengl/PGraphicsOpenGL.java index 88164f43e1..b00fa43f92 100644 --- a/core/src/processing/opengl/PGraphicsOpenGL.java +++ b/core/src/processing/opengl/PGraphicsOpenGL.java @@ -5512,8 +5512,11 @@ protected void setImpl(PImage sourceImage, int targetX, int targetY) { updatePixelSize(); - // Copies the pixels + // make sure pixel arrays are available loadPixels(); + sourceImage.loadPixels(); + + // Copies the pixels int sourceOffset = sourceY * sourceImage.pixelWidth + sourceX; int targetOffset = targetY * pixelWidth + targetX; for (int y = sourceY; y < sourceY + sourceHeight; y++) {