Skip to content

Commit

Permalink
Fix maximum value in sliders
Browse files Browse the repository at this point in the history
  • Loading branch information
fvantienen committed Feb 8, 2024
1 parent 2f801ae commit b0779dc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/widgets/basics/double_slider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include <QToolTip>
#include <QWheelEvent>
#include <QDebug>
#include <math.h>

DoubleSlider::DoubleSlider(Qt::Orientation orientation, QWidget *parent) : QSlider(orientation, parent)
{
Expand All @@ -20,7 +21,7 @@ void DoubleSlider::setDoubleRange(double mi, double ma, double sp) {
min = mi;
max = ma;
step = sp;
int nb_steps = (max - min) / step + 1;
int nb_steps = ceil((max - min) / step);
setRange(0, nb_steps);
if(nb_steps < 20) {
setTickPosition(QSlider::TicksBelow);
Expand Down

0 comments on commit b0779dc

Please sign in to comment.