From a28058fb55d1a871ec3d42a3cf3c4a402bca287c Mon Sep 17 00:00:00 2001 From: Samuel Pantze <83579186+smlpt@users.noreply.github.com> Date: Fri, 9 Feb 2024 14:55:37 +0100 Subject: [PATCH 1/2] SciView: set active node only when centerOnNewNodes is true --- src/main/kotlin/sc/iview/SciView.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/sc/iview/SciView.kt b/src/main/kotlin/sc/iview/SciView.kt index c01f0ea6..579e9c5d 100644 --- a/src/main/kotlin/sc/iview/SciView.kt +++ b/src/main/kotlin/sc/iview/SciView.kt @@ -890,10 +890,10 @@ class SciView : SceneryBase, CalibratedRealInterval { Utils.blockWhile({ this.find(n.name) == null }, 20) //System.out.println("find(name) " + find(n.getName()) ); } - // Set new node as active and centered? - setActiveNode(n) + // Set new node as active and centered if (centerOnNewNodes) { centerOnNode(n) + setActiveNode(n) } if (activePublish) { eventService.publish(NodeAddedEvent(n)) From 7d00eea7a5bdc09d910934895cd26a63e804b564 Mon Sep 17 00:00:00 2001 From: Samuel Pantze <83579186+smlpt@users.noreply.github.com> Date: Mon, 12 Feb 2024 11:56:01 +0100 Subject: [PATCH 2/2] SciView: setActive is only called when publish is true --- src/main/kotlin/sc/iview/SciView.kt | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main/kotlin/sc/iview/SciView.kt b/src/main/kotlin/sc/iview/SciView.kt index 579e9c5d..aaa1519d 100644 --- a/src/main/kotlin/sc/iview/SciView.kt +++ b/src/main/kotlin/sc/iview/SciView.kt @@ -890,13 +890,14 @@ class SciView : SceneryBase, CalibratedRealInterval { Utils.blockWhile({ this.find(n.name) == null }, 20) //System.out.println("find(name) " + find(n.getName()) ); } - // Set new node as active and centered - if (centerOnNewNodes) { - centerOnNode(n) - setActiveNode(n) - } + if (activePublish) { eventService.publish(NodeAddedEvent(n)) + setActiveNode(n) + // Set new node as centered + if (centerOnNewNodes) { + centerOnNode(n) + } } } return n