Scissor logic in calculateAbsoluteObstructingRectangles

This commit is contained in:
DBotThePony 2022-10-17 00:23:09 +07:00
parent 9a218de5e7
commit dd686e23c5
Signed by: DBot
GPG Key ID: DCC23B5715498507

View File

@ -489,7 +489,12 @@ open class EditablePanel<out S : Screen> @JvmOverloads constructor(
}
fun calculateAbsoluteObstructingRectangles(): List<Rect2f> {
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))
}