aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fischer@muhq.space>2025-07-04 08:46:24 -0400
committerFlorian Fischer <florian.fischer@muhq.space>2025-07-06 11:49:19 -0400
commit53ba6a1c0cd020f26d501912320a41e8dc736976 (patch)
treea841282014f9a06ab49d4ba7033e922d9adc1628
parent398d8967abba54a7703c2c240559659dee5727ce (diff)
downloadmuhqs-game-53ba6a1c0cd020f26d501912320a41e8dc736976.tar.gz
muhqs-game-53ba6a1c0cd020f26d501912320a41e8dc736976.zip
use constants instead of hardcoded values
-rw-r--r--go/ui/textBox.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/go/ui/textBox.go b/go/ui/textBox.go
index 0e8adf5f..7f8d75ee 100644
--- a/go/ui/textBox.go
+++ b/go/ui/textBox.go
@@ -105,7 +105,7 @@ func NewPermInfo(x, y int, p game.Permanent) *TextBox {
func (tb *TextBox) render() *ebiten.Image {
var x, y float64
w, h := text.Measure(tb.text, tb.font, tb.font.Size*tb.lineSpacing)
- if tb.Width == -1 || tb.Height == -1 {
+ if tb.Width == TEXTBOX_AUTO_DIMENSION || tb.Height == TEXTBOX_AUTO_DIMENSION {
tb.Width = int(w) + 2*tb.XMargin
tb.Height = int(h) + 2*tb.YMargin
x = float64(tb.XMargin)