diff --git a/de.uniwue.mk.athen/bundles/de.uniwue.mk.kall.athen.part.editor/src/de/uniwue/mk/kall/athen/widget/editor/AnnotationEditorWidget.java b/de.uniwue.mk.athen/bundles/de.uniwue.mk.kall.athen.part.editor/src/de/uniwue/mk/kall/athen/widget/editor/AnnotationEditorWidget.java index 2975ebeff838deb864d34a74b526d3bb6c2c7b05..717b72742f717da35f17f03432c1304afb8d4498 100644 --- a/de.uniwue.mk.athen/bundles/de.uniwue.mk.kall.athen.part.editor/src/de/uniwue/mk/kall/athen/widget/editor/AnnotationEditorWidget.java +++ b/de.uniwue.mk.athen/bundles/de.uniwue.mk.kall.athen.part.editor/src/de/uniwue/mk/kall/athen/widget/editor/AnnotationEditorWidget.java @@ -126,6 +126,7 @@ public class AnnotationEditorWidget extends Composite { private boolean preventPaintListenerPaint; private Type activeModeType; private Point pointOfLastPaint; + private Image blankBackground; public AnnotationEditorWidget(Composite parent, int style) { super(parent, style); @@ -793,7 +794,10 @@ public class AnnotationEditorWidget extends Composite { // set the background of the image to white so that we cannot see any // relicts from previous iterations Rectangle clientArea = widget.getClientArea(); - Image blankBackground = new Image(Display.getCurrent(), clientArea); + if(blankBackground!=null){ + blankBackground.dispose(); + } + blankBackground = new Image(Display.getCurrent(), clientArea); widget.setBackgroundImage(blankBackground); // this method gets All Annotations that are visible atm @@ -887,7 +891,7 @@ public class AnnotationEditorWidget extends Composite { // widget.notifyListeners(SWT.Paint, event); // event.gc.dispose(); - blankBackground.dispose(); + }