]> gerrit.simantics Code Review - simantics/3d.git/commitdiff
Fix removed nodes leaving visible graphical elements. 73/3673/1
authorMarko Luukkainen <marko.luukkainen@semantum.fi>
Thu, 5 Dec 2019 09:16:58 +0000 (11:16 +0200)
committerMarko Luukkainen <marko.luukkainen@semantum.fi>
Thu, 5 Dec 2019 09:16:58 +0000 (11:16 +0200)
When a node was removed and updated at the same cycle, it:
1. Was removed
2. Graphics were updated, which added graphics back to the visualization

gitlab #35

Change-Id: Ic512d450ea015f6969dd901558b36caaa88754bd

org.simantics.g3d.vtk/src/org/simantics/g3d/vtk/common/AbstractVTKNodeMap.java

index f4458fc34bd47731a2073279cc344d864e8faab3..4bcb5df271b53f5c3b8f8651d5146b1096e54540 100644 (file)
@@ -497,7 +497,10 @@ public abstract class AbstractVTKNodeMap<DBObject,E extends INode> implements VT
                        }
                    }
                }
-               
+               // Do not process updates for removed nodes.
+               for (Pair<E, String> r : removed) {
+                   updated.removeValues(r.first);
+               }
                        rem.addAll(removed);
                        add.addAll(added);
                        for (E e : updated.getKeys()) {