Skip to content

Fix bug where threshold lines were added twice#2062

Merged
petebankhead merged 1 commit intoqupath:mainfrom
Rylern:threshold-line-added-twice
Jan 8, 2026
Merged

Fix bug where threshold lines were added twice#2062
petebankhead merged 1 commit intoqupath:mainfrom
Rylern:threshold-line-added-twice

Conversation

@Rylern
Copy link
Contributor

@Rylern Rylern commented Jan 8, 2026

Before this PR, calling ChartThresholdPane.addThreshold() was adding a threshold line twice, because:

  • addThreshold(final ObservableNumberValue d, final Color color) was adding a first line.
  • At the end of addThreshold(final ObservableNumberValue d, final Color color), thresholds.add(d); is called. This triggers handleLineListChange() to be called.
  • handleLineListChange() calls addThreshold(ObservableNumberValue), which calls addThreshold(final ObservableNumberValue d, final Color color): this adds the second line.

This PR fixes that by only creating the line in handleLineListChange(). The addThreshold() functions now just update thresholds (which triggers handleLineListChange()).

@Rylern Rylern requested a review from petebankhead January 8, 2026 10:50
@petebankhead petebankhead merged commit 49d80e9 into qupath:main Jan 8, 2026
3 checks passed
@Rylern Rylern deleted the threshold-line-added-twice branch January 9, 2026 09:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants