-
Notifications
You must be signed in to change notification settings - Fork 493
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BUG: Ensure that the min/max values can be reached in ctkDoubleSlider…
… and ctkDoubleRangeSlider The minimum and maximum values were not always reachable in ctkDoubleSlider and ctkDoubleRangeSlider widgets when moved the slider to the minimum or maximum position. For example: ``` lo = -1024 hi = 2000 step = (hi - lo) / 1000. thresholdSlider = ctk.ctkRangeWidget() thresholdSlider.spinBoxAlignment = qt.Qt.AlignTop thresholdSlider.setRange(lo, hi) thresholdSlider.singleStep = step thresholdSlider.show() # Impossible to reach 2000.0 slider = ctk.ctkDoubleSlider() slider.minimum = lo slider.maximum = hi slider.singleStep = step slider.show() slider.connect("valueChanged(double)", lambda v: print(v)) # Impossible to reach 2000.0 ``` The problem was that the integer slider range was determined by rounding, which could result in the integer slider range not covering the entire value range. Fixed the problem by extending the integer slider range when it did not fully cover the value range. Co-authored-by: Jean-Christophe Fillion-Robin <[email protected]>
- Loading branch information
Showing
5 changed files
with
113 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters