From dd686e23c5b12ef500f605f4cece847d7deb49f6 Mon Sep 17 00:00:00 2001 From: DBotThePony Date: Mon, 17 Oct 2022 00:23:09 +0700 Subject: [PATCH] Scissor logic in calculateAbsoluteObstructingRectangles --- .../mc/otm/client/screen/panels/EditablePanel.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/panels/EditablePanel.kt b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/panels/EditablePanel.kt index 011b4ea92..13b302bae 100644 --- a/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/panels/EditablePanel.kt +++ b/src/main/kotlin/ru/dbotthepony/mc/otm/client/screen/panels/EditablePanel.kt @@ -489,7 +489,12 @@ open class EditablePanel @JvmOverloads constructor( } fun calculateAbsoluteObstructingRectangles(): List { - if (childrenRectX >= 0 && childrenRectY >= 0 && childrenRectWidth <= width && childrenRectHeight <= height && isObstructing) { + if ((scissor || childrenRectX >= 0 && childrenRectY >= 0 && childrenRectWidth <= width && childrenRectHeight <= height) && isObstructing) { + return listOf(Rect2f(absoluteX, absoluteY, width, height)) + } + + if (scissor && !isObstructing) { + // TODO: NYI return listOf(Rect2f(absoluteX, absoluteY, width, height)) }