diff --git a/src/main/kotlin/net/prismclient/aether/ui/component/type/input/button/UIButton.kt b/src/main/kotlin/net/prismclient/aether/ui/component/type/input/button/UIButton.kt index 26fcf0f..452391b 100644 --- a/src/main/kotlin/net/prismclient/aether/ui/component/type/input/button/UIButton.kt +++ b/src/main/kotlin/net/prismclient/aether/ui/component/type/input/button/UIButton.kt @@ -14,16 +14,28 @@ open class UIButton(text: String) : UIComponent() { set(value) { field = value style.font?.actualText = text + updateFont() } override fun update() { super.update() style.font?.actualText = text + updateFont() } override fun renderComponent() { style.font?.render() } + fun updateFont() { + width = width.coerceAtLeast(style.font?.cachedWidth ?: 0f) + height = height.coerceAtLeast(style.font?.cachedHeight ?: 0f) + updateAnchorPoint() + updatePosition() + updateBounds() + updateStyle() + style.font?.updateFont() + } + override fun createsStyle(): UIStyleSheet = UIStyleSheet() } \ No newline at end of file