From 01408701f9d00f542d69b82923d4a058faf81c3d Mon Sep 17 00:00:00 2001 From: Oliver 'kfsone' Smith Date: Wed, 24 Feb 2021 13:51:09 -0800 Subject: [PATCH] Use ConstrainRectangle in combobox.go --- raygui/combobox.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/raygui/combobox.go b/raygui/combobox.go index 399109a..3de56e6 100644 --- a/raygui/combobox.go +++ b/raygui/combobox.go @@ -38,12 +38,7 @@ func ComboBox(bounds rl.Rectangle, comboText []string, active int) int { textWidth := rl.MeasureText(activeText, textHeight) // Ensure box is large enough. - if int32(bounds.Width) < textWidth { - bounds.Width = float32(textWidth + GetStyle32(ToggleTextPadding)) - } - if int32(bounds.Height) < textHeight { - bounds.Height = float32(textHeight + GetStyle32(ToggleTextPadding)) - } + ConstrainRectangle(&bounds, textWidth, textWidth + GetStyle32(ToggleTextPadding), textHeight, textHeight + GetStyle32(ToggleTextPadding)) b := bounds.ToInt32() // Generate the worst-case sizing of the counter so we can avoid resizing it as the numbers go up/down.