Fix width of lua float edits
Float edits with a spinner are by default sized to fit their full min-max range of possible values, so this makes min and max default to 0 and 100 (like it'd done internally in wx) instead of -DOUBLE_MAX and DOUBLE_MAX. Note that this does change the behavior of lua dialogs, but does not contradict existing documentation or specification. It should only affect scripts who either disobey the specification by specifying only one value out of max/min, or scripts displaying these large float edits by specifing a step, but no max or min.
This commit is contained in:
parent
1772dd17ae
commit
9ebe154964
1 changed files with 4 additions and 0 deletions
|
@ -284,6 +284,10 @@ namespace Automation4 {
|
|||
max = DBL_MAX;
|
||||
min = -DBL_MAX;
|
||||
}
|
||||
if (step != 0.0) {
|
||||
min = min == -DBL_MAX ? 0.0 : min;
|
||||
max = max == DBL_MAX ? 100.0 : max;
|
||||
}
|
||||
}
|
||||
|
||||
bool CanSerialiseValue() const override { return true; }
|
||||
|
|
Loading…
Add table
Reference in a new issue