X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.g2d%2Fsrc%2Forg%2Fsimantics%2Fg2d%2Fgallery%2FGalleryViewer.java;h=d09ecf4a6b6f753f7f0adbf57060b3a36ac987c1;hp=ce5687e8486e05b38f4ca2b28efd72fa8af7b9c7;hb=215cb2930ed3fb362b2951d1da3080abec976972;hpb=ec70c03d4ce3f68b71de5eeadce3d008620c5521 diff --git a/bundles/org.simantics.g2d/src/org/simantics/g2d/gallery/GalleryViewer.java b/bundles/org.simantics.g2d/src/org/simantics/g2d/gallery/GalleryViewer.java index ce5687e84..d09ecf4a6 100644 --- a/bundles/org.simantics.g2d/src/org/simantics/g2d/gallery/GalleryViewer.java +++ b/bundles/org.simantics.g2d/src/org/simantics/g2d/gallery/GalleryViewer.java @@ -631,8 +631,10 @@ public class GalleryViewer extends ContentViewer { ctx.getThreadAccess().asyncExec(() -> { //System.out.println(Thread.currentThread() + ": update scene graph(" + el + ")"); // Update scene graph and repaint. - el.getElementClass().getSingleItem(GalleryItemSGNode.class).update(el); - ctx.getContentContext().setDirty(); + if (!ctx.isDisposed()) { + el.getElementClass().getSingleItem(GalleryItemSGNode.class).update(el); + ctx.getContentContext().setDirty(); + } }); break; } @@ -673,7 +675,7 @@ public class GalleryViewer extends ContentViewer { static class GalleryItemPainter extends ElementPainter { @Override - public void paintSelectionFrame(G2DParentNode elementNode, G2DParentNode selectionNode, IElement e, Color color) { + public void paintSelectionFrame(int selectionId, G2DParentNode elementNode, G2DParentNode selectionNode, IElement e, Color color) { final Shape outline = ElementUtils.getElementBoundsOnDiagram(e); Rectangle2D bounds = outline.getBounds2D(); GeometryUtils.expandRectangle(bounds, 2, 2, 2, 2);