From 5f95876003479722b68d9436af7a7cf9b610f634 Mon Sep 17 00:00:00 2001 From: Jonas Herzig Date: Thu, 2 May 2024 14:55:21 +0200 Subject: [PATCH] WindowScreen: Fix background being draw on top of screen This was clearly wrong; just no one ever noticed because the vanilla content drawn by `super.onDrawScreen` (e.g. vanilla buttons) is usually empty for Elementa screens. But now that I've seen it, I can't just keep it like that. --- src/main/kotlin/gg/essential/elementa/WindowScreen.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/kotlin/gg/essential/elementa/WindowScreen.kt b/src/main/kotlin/gg/essential/elementa/WindowScreen.kt index bfacc28e..e4488e5d 100644 --- a/src/main/kotlin/gg/essential/elementa/WindowScreen.kt +++ b/src/main/kotlin/gg/essential/elementa/WindowScreen.kt @@ -48,11 +48,11 @@ abstract class WindowScreen @JvmOverloads constructor( afterInitialization() } - super.onDrawScreen(matrixStack, mouseX, mouseY, partialTicks) - if (drawDefaultBackground) super.onDrawBackground(matrixStack, 0) + super.onDrawScreen(matrixStack, mouseX, mouseY, partialTicks) + // Now, we need to hook up Elementa to this GuiScreen. In practice, Elementa // is not constrained to being used solely inside of a GuiScreen, all the programmer // needs to do is call the [Window] events when appropriate, whenever that may be.