Skip to content

Commit

Permalink
fix: Crash on some config pages involving checkboxes
Browse files Browse the repository at this point in the history
  • Loading branch information
nea89o committed Feb 17, 2025
1 parent 9cce9dd commit 44fa3b0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main/kotlin/gui/CheckboxComponent.kt
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ class CheckboxComponent<T>(
val ctx = (context.renderContext as ModernRenderContext).drawContext
ctx.drawGuiTexture(
RenderLayer::getGuiTextured,
if (isEnabled()) Firmament.identifier("firmament:widget/checkbox_checked")
else Firmament.identifier("firmament:widget/checkbox_unchecked"),
if (isEnabled()) Firmament.identifier("widget/checkbox_checked")
else Firmament.identifier("widget/checkbox_unchecked"),
0, 0,
16, 16
)
Expand All @@ -43,6 +43,7 @@ class CheckboxComponent<T>(
isClicking = false
if (context.isHovered)
state.set(value)
blur()
return true
}
if (mouseEvent.mouseState && mouseEvent.mouseButton == 0 && context.isHovered) {
Expand Down

0 comments on commit 44fa3b0

Please sign in to comment.