Skip to content

Commit

Permalink
Merge pull request #551 from scenerygraphics/fix/fix-set-active-node
Browse files Browse the repository at this point in the history
SciView: set active node only when centerOnNewNodes is true
  • Loading branch information
kephale authored Feb 12, 2024
2 parents 05e76f5 + 7d00eea commit 80c8403
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/main/kotlin/sc/iview/SciView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -890,13 +890,14 @@ class SciView : SceneryBase, CalibratedRealInterval<CalibratedAxis> {
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)
if (centerOnNewNodes) {
centerOnNode(n)
}

if (activePublish) {
eventService.publish(NodeAddedEvent(n))
setActiveNode(n)
// Set new node as centered
if (centerOnNewNodes) {
centerOnNode(n)
}
}
}
return n
Expand Down

0 comments on commit 80c8403

Please sign in to comment.