Skip to content

Commit

Permalink
Correctly set value range on FloatVariables and increase decimals shown
Browse files Browse the repository at this point in the history
  • Loading branch information
Moondragon85 authored Sep 2, 2021
1 parent 626787b commit 37ba776
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion gremlin/user_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,8 @@ def create_ui_element(self, value):
)
elif self.variable_type == common.PluginVariableType.Float:
value_widget = QtWidgets.QDoubleSpinBox()
value_widget.setDecimals(3)
value_widget.setRange(self.min_value, self.max_value)
value_widget.setValue(float(value))
value_widget.valueChanged.connect(
lambda x: self.value_changed.emit({"value": x})
Expand Down Expand Up @@ -413,7 +415,7 @@ def __init__(
is_optional
)

_init_numerical(self, 0, -1.0, 1.0)
_init_numerical(self, 0.0, -1.0, 1.0)
self._load_from_registry(self._get_identifier())


Expand Down

0 comments on commit 37ba776

Please sign in to comment.