Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/main/kotlin/gg/essential/elementa/UIComponent.kt
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ import gg.essential.elementa.state.v2.ReferenceHolder
import gg.essential.elementa.utils.*
import gg.essential.elementa.utils.requireMainThread
import gg.essential.elementa.utils.requireState
import gg.essential.universal.UGraphics
import gg.essential.universal.UMatrixStack
import gg.essential.universal.UMouse
import gg.essential.universal.UResolution
import org.lwjgl.opengl.GL11
import java.awt.Color
import java.util.*
import java.util.concurrent.ConcurrentHashMap
Expand Down Expand Up @@ -1800,8 +1800,9 @@ abstract class UIComponent : Observable(), ReferenceHolder {
* Draws a colored outline around a given area
*/
internal fun drawDebugOutline(matrixStack: UMatrixStack,left: Double, top: Double, right: Double, bottom: Double, component: UIComponent) {
if (ScissorEffect.currentScissorState != null) {
GL11.glDisable(GL11.GL_SCISSOR_TEST)
val scissorState = ScissorEffect.currentScissorState
if (scissorState != null) {
UGraphics.disableScissor()
}

val color = getDebugColor(component.depth(), (component.parent.hashCode() / PI) % PI)
Expand Down Expand Up @@ -1832,8 +1833,8 @@ abstract class UIComponent : Observable(), ReferenceHolder {
// Left outline block
UIBlock.drawBlock(matrixStack, color, left - DEBUG_OUTLINE_WIDTH, top, left, bottom)

if (ScissorEffect.currentScissorState != null) {
GL11.glEnable(GL11.GL_SCISSOR_TEST)
if (scissorState != null) {
UGraphics.enableScissor(scissorState.x, scissorState.y, scissorState.width, scissorState.height)
}
}

Expand Down
3 changes: 1 addition & 2 deletions src/main/kotlin/gg/essential/elementa/components/Window.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import gg.essential.elementa.font.FontRenderer
import gg.essential.elementa.utils.elementaDev
import gg.essential.elementa.utils.requireMainThread
import gg.essential.universal.*
import org.lwjgl.opengl.GL11
import java.util.concurrent.ConcurrentLinkedQueue
import java.util.concurrent.TimeUnit

Expand Down Expand Up @@ -178,7 +177,7 @@ class Window @JvmOverloads constructor(
// We may have thrown in the middle of a ScissorEffect, in which case we
// need to disable the scissor if we don't want half the user's screen gone
ScissorEffect.currentScissorState = null
GL11.glDisable(GL11.GL_SCISSOR_TEST)
UGraphics.disableScissor()

UMinecraft.currentScreenObj = when {
e is StackOverflowError && elementaDev -> {
Expand Down
Loading