Fix frame tabs being too wide

This commit is contained in:
DBotThePony 2023-07-29 17:50:42 +07:00
parent 1a9877a49d
commit dde37bc502
Signed by: DBot
GPG Key ID: DCC23B5715498507

View File

@ -32,7 +32,7 @@ open class FramePanel<out S : Screen>(
var onClose: Runnable? = null,
var activeIcon: IGUIRenderable? = null,
var inactiveIcon: IGUIRenderable? = null,
) : AbstractButtonPanel<S>(this@FramePanel.screen, this@FramePanel, 0f, 0f, 28f, 28f) {
) : AbstractButtonPanel<S>(this@FramePanel.screen, this@FramePanel, 0f, 0f, 26f, 28f) {
var isActive = tabs.isEmpty()
init {
@ -81,7 +81,7 @@ open class FramePanel<out S : Screen>(
}
}
activeIcon?.render(graphics, x = width / 2f - 1f, y = height / 2f + 1f, gravity = RenderGravity.CENTER_CENTER)
activeIcon?.render(graphics, x = width / 2f, y = height / 2f + 1f, gravity = RenderGravity.CENTER_CENTER)
} else {
if (tabIndex() == 0) {
if (isDisabled) {
@ -105,7 +105,7 @@ open class FramePanel<out S : Screen>(
}
}
inactiveIcon?.render(graphics, x = width / 2f - 1f, y = height / 2f + 1f, gravity = RenderGravity.CENTER_CENTER)
inactiveIcon?.render(graphics, x = width / 2f, y = height / 2f + 1f, gravity = RenderGravity.CENTER_CENTER)
}
}