@@ -20,10 +20,10 @@ import gg.essential.elementa.state.v2.ReferenceHolder
2020import gg.essential.elementa.utils.*
2121import gg.essential.elementa.utils.requireMainThread
2222import gg.essential.elementa.utils.requireState
23+ import gg.essential.universal.UGraphics
2324import gg.essential.universal.UMatrixStack
2425import gg.essential.universal.UMouse
2526import gg.essential.universal.UResolution
26- import org.lwjgl.opengl.GL11
2727import java.awt.Color
2828import java.util.*
2929import java.util.concurrent.ConcurrentHashMap
@@ -1800,8 +1800,9 @@ abstract class UIComponent : Observable(), ReferenceHolder {
18001800 * Draws a colored outline around a given area
18011801 */
18021802 internal fun drawDebugOutline (matrixStack : UMatrixStack ,left : Double , top : Double , right : Double , bottom : Double , component : UIComponent ) {
1803- if (ScissorEffect .currentScissorState != null ) {
1804- GL11 .glDisable(GL11 .GL_SCISSOR_TEST )
1803+ val scissorState = ScissorEffect .currentScissorState
1804+ if (scissorState != null ) {
1805+ UGraphics .disableScissor()
18051806 }
18061807
18071808 val color = getDebugColor(component.depth(), (component.parent.hashCode() / PI ) % PI )
@@ -1832,8 +1833,8 @@ abstract class UIComponent : Observable(), ReferenceHolder {
18321833 // Left outline block
18331834 UIBlock .drawBlock(matrixStack, color, left - DEBUG_OUTLINE_WIDTH , top, left, bottom)
18341835
1835- if (ScissorEffect .currentScissorState != null ) {
1836- GL11 .glEnable( GL11 . GL_SCISSOR_TEST )
1836+ if (scissorState != null ) {
1837+ UGraphics .enableScissor(scissorState.x, scissorState.y, scissorState.width, scissorState.height )
18371838 }
18381839 }
18391840
0 commit comments