Skip to content

Commit 24fbd72

Browse files
Reinitializing image with image data after post process
1 parent f256493 commit 24fbd72

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/graphics/ImageGcDrawer.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ public interface ImageGcDrawer {
4545
* @param imageData The resulting ImageData after <code>drawOn</code> was called
4646
*/
4747
default void postProcess(ImageData imageData) {
48+
imageData.data = null;
4849
}
4950

5051
/**

bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/graphics/Image.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2561,6 +2561,10 @@ protected ImageHandle newImageHandle(int zoom) {
25612561
drawer.drawOn(gc, width, height);
25622562
ImageData imageData = Image.this.getImageMetadata(zoom).getImageData();
25632563
drawer.postProcess(imageData);
2564+
if(imageData.data != null) {
2565+
zoomLevelToImageHandle.get(zoom).destroy();
2566+
init(imageData, zoom);
2567+
}
25642568
return zoomLevelToImageHandle.get(zoom);
25652569
} finally {
25662570
gc.dispose();

0 commit comments

Comments
 (0)