Skip to content

Commit

Permalink
fix(graphics): 🐛 Fixed a bug with the new input boxes and also made t…
Browse files Browse the repository at this point in the history
…he wrapping input boxes have decimals and just generally be better
  • Loading branch information
Tsunami014 (Max) authored and Tsunami014 (Max) committed Dec 16, 2024
1 parent 530752a commit 3192b8f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion BlazeSudio/graphics/GUI/elements.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]:
Expand Down
4 changes: 2 additions & 2 deletions demos.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 3192b8f

Please sign in to comment.