Skip to content

Commit 7490ac4

Browse files
DanySKCopilot
andcommitted
Update alchemist-swingui/src/main/java/it/unibo/alchemist/boundary/swingui/monitor/impl/Generic2DDisplay.java
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent fa93b27 commit 7490ac4

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

alchemist-swingui/src/main/java/it/unibo/alchemist/boundary/swingui/monitor/impl/Generic2DDisplay.java

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -338,12 +338,16 @@ protected void drawEnvOnView(final Graphics2D g) {
338338
return;
339339
}
340340
accessData();
341-
updateHookedNodeView();
342-
final Map<Node<T>, Point> onView = computeNodesOnView();
343-
g.setColor(Color.BLACK);
344-
drawObstacles(g);
345-
drawLinks(g, onView);
346-
releaseData();
341+
final Map<Node<T>, Point> onView;
342+
try {
343+
updateHookedNodeView();
344+
onView = computeNodesOnView();
345+
g.setColor(Color.BLACK);
346+
drawObstacles(g);
347+
drawLinks(g, onView);
348+
} finally {
349+
releaseData();
350+
}
347351
moveSelectedNodesOnView(onView);
348352
g.setColor(Color.GREEN);
349353
if (effectStack != null) {

0 commit comments

Comments
 (0)