Skip to content

Commit

Permalink
Fix databrowser trace issue for visibility of annotations
Browse files Browse the repository at this point in the history
Annotations has to be reset for plot when there is change for visibility of item in model.
  • Loading branch information
thelarsjohansson committed Jun 11, 2024
1 parent 24521bd commit dff0528
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@ public void itemRemoved(final ModelItem item)
public void changedItemVisibility(final ModelItem item)
{
plot.updateTrace(item);
changedAnnotations();
}

@Override
Expand Down Expand Up @@ -486,7 +487,13 @@ public void changedAnnotations()
if (changing_annotations)
return;
changing_annotations = true;
plot.setAnnotations(model.getAnnotations());
List<AnnotationInfo> annotations = new ArrayList<>();
for (AnnotationInfo ai : model.getAnnotations()) {
if (model.getItems().get(ai.getItemIndex()).isVisible()) {
annotations.add(ai);
}
}
plot.setAnnotations(annotations);
changing_annotations = false;
}
};
Expand Down

0 comments on commit dff0528

Please sign in to comment.