Browse Source

Fix param bounds in bulti-in editor

tags/1.9.4
falkTX 10 years ago
parent
commit
c9aa1d76a6
1 changed files with 12 additions and 2 deletions
  1. +12
    -2
      source/widgets/paramspinbox.py

+ 12
- 2
source/widgets/paramspinbox.py View File

@@ -418,8 +418,18 @@ class ParamSpinBox(QAbstractSpinBox):
if self.fIsReadOnly: if self.fIsReadOnly:
return return


step = int((value - self.fMinimum) / self.fStep + 0.5)
realValue = self.fMinimum + (step * self.fStep)
if value <= self.fMinimum:
realValue = self.fMinimum
elif value >= self.fMaximum:
realValue = self.fMaximum
else:
curStep = int((value - self.fMinimum) / self.fStep + 0.5)
realValue = self.fMinimum + (self.fStep * curStep)

if realValue < self.fMinimum:
realValue = self.fMinimum
elif realValue > self.fMaximum:
realValue = self.fMaximum


self.setValue(realValue) self.setValue(realValue)




Loading…
Cancel
Save