Skip to content

Commit

Permalink
Removed scaled Graphics from thumbnail creation
Browse files Browse the repository at this point in the history
  • Loading branch information
azoitl committed Aug 2, 2023
1 parent 1d4c086 commit ca2506f
Showing 1 changed file with 2 additions and 14 deletions.
16 changes: 2 additions & 14 deletions org.eclipse.draw2d/src/org/eclipse/draw2d/parts/Thumbnail.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import org.eclipse.draw2d.Graphics;
import org.eclipse.draw2d.IFigure;
import org.eclipse.draw2d.SWTGraphics;
import org.eclipse.draw2d.ScaledGraphics;
import org.eclipse.draw2d.UpdateListener;
import org.eclipse.draw2d.geometry.Dimension;
import org.eclipse.draw2d.geometry.Rectangle;
Expand Down Expand Up @@ -63,8 +62,7 @@ class ThumbnailUpdater implements Runnable {
private Dimension tileImageSize;
// GC and Graphics to let the source figure paint on the tile image
private GC tileGC;
private SWTGraphics tileGCGraphics;
private ScaledGraphics tileGraphics;
private SWTGraphics tileGraphics;
// GC used to copy from the tile image into the thumbnail image
private GC thumbnailGC;

Expand Down Expand Up @@ -301,16 +299,10 @@ private void createTileGraphics() {
tileGC = new GC(tileImage, sourceFigure.isMirrored() ? SWT.RIGHT_TO_LEFT : SWT.NONE);

// ...and this means we need a new SWTGraphics instance
if (tileGCGraphics != null) {
tileGCGraphics.dispose();
}
tileGCGraphics = new SWTGraphics(tileGC);

// ...and a new ScaledGraphics instance
if (tileGraphics != null) {
tileGraphics.dispose();
}
tileGraphics = new ScaledGraphics(tileGCGraphics);
tileGraphics = new SWTGraphics(tileGC);

Color color = sourceFigure.getForegroundColor();
if (color != null) {
Expand Down Expand Up @@ -361,10 +353,6 @@ public void stop() {
tileGraphics.dispose();
tileGraphics = null;
}
if (tileGCGraphics != null) {
tileGCGraphics.dispose();
tileGCGraphics = null;
}
if (tileGC != null) {
tileGC.dispose();
tileGC = null;
Expand Down

0 comments on commit ca2506f

Please sign in to comment.