diff --git a/BlazeSudio/graphics/GUI/elements.py b/BlazeSudio/graphics/GUI/elements.py index e91d194..5ecff82 100644 --- a/BlazeSudio/graphics/GUI/elements.py +++ b/BlazeSudio/graphics/GUI/elements.py @@ -355,7 +355,10 @@ def _handle_text(self, event): def fix(self): if self.text == '': return - num = float(self.text) + if self.text == '-': + num = 0 + else: + num = float(self.text) if float(num) > self.limits[1]: self.text = str(self.limits[1]) elif float(num) < self.limits[0]: diff --git a/demos.py b/demos.py index 41dde5b..81bcfc7 100644 --- a/demos.py +++ b/demos.py @@ -482,9 +482,9 @@ def _LoadUI(self): self.offset = len(topF['Main']) topF['Main'].extend([ GUI.Text(topF, RTOP, 'Top'), - GUI.NumInputBox(topF, RTOP, 100, GO.RHEIGHT, start=1, min=0, max=2, placeholdOnNum=None), + GUI.NumInputBox(topF, RTOP, 100, GO.RHEIGHT, empty=1, min=0, max=2, placeholdOnNum=None, decimals=8), GUI.Text(topF, RTOP, 'Bottom'), - GUI.NumInputBox(topF, RTOP, 100, GO.RHEIGHT, start=-1, min=-1, max=0, placeholdOnNum=None), + GUI.NumInputBox(topF, RTOP, 100, GO.RHEIGHT, empty=-1, min=-1, max=0, placeholdOnNum=None, decimals=8), ]) topF['Main'].append(GUI.Text(topF, GO.PCTOP, 'INPUT IMAGE', font=GO.FTITLE))