aboutsummaryrefslogtreecommitdiffstats
path: root/gui/widget/input.go
diff options
context:
space:
mode:
authorSam Anthony <sam@samanthony.xyz>2024-05-10 13:12:38 -0400
committerSam Anthony <sam@samanthony.xyz>2024-05-10 13:12:38 -0400
commita9895419352c374e32b8c8ac552abcb8a398caf9 (patch)
tree7612ac9d4863201155b3c16cdd09ff52015cb983 /gui/widget/input.go
parent221e3dea36880a7ff45a4a8b3f33fec3b261c2c4 (diff)
downloadvolute-a9895419352c374e32b8c8ac552abcb8a398caf9.zip
move helper functions to input widget file
Diffstat (limited to 'gui/widget/input.go')
-rw-r--r--gui/widget/input.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/gui/widget/input.go b/gui/widget/input.go
index d4d6738..f6c1dbc 100644
--- a/gui/widget/input.go
+++ b/gui/widget/input.go
@@ -72,3 +72,15 @@ func inputDraw(str []byte, focused bool, r image.Rectangle) func(draw.Image) ima
return r
}
}
+
+func isDigit(r rune) bool {
+ return '0' <= r && r <= '9'
+}
+
+func atoi(s []byte) uint {
+ var n uint = 0
+ for _, d := range s {
+ n = n*10 + uint(d-'0')
+ }
+ return n
+}