
OwoUIDrawContext#intersectsScissor(PositionRectangle) not respecting MatrixStack transformation
Closed this issue · 1 comments
Minecraft's DrawContext#enableScissor(int, int, int, int)
transformes the Scissor according to the MatrixStack:
(Snipper)
public void enableScissor(int x1, int y1, int x2, int y2) {
ScreenRect screenRect = (new ScreenRect(x1, y1, x2 - x1, y2 - y1)).transform(this.matrices);
this.scissorStack.push(screenRect);
}
However, owo's intersectsScissor does not respect that transformation:
owo-lib/src/main/java/io/wispforest/owo/ui/core/OwoUIDrawContext.java
Lines 64 to 75 in 94e0c37
This is fine as long as the translation is 0,0.
When rendering a toast for example, then it is not possible to use OwoUIAdapter
, because it scissors the entire screen (which isn't an issue):
owo-lib/src/main/java/io/wispforest/owo/ui/core/OwoUIAdapter.java
Lines 180 to 182 in 94e0c37
But then
BaseParentComponent
checks for the scissor intersection before drawing:The scissor intersection returns false, even though it should return true. And the toast won't render.
Should be fixed in 93380d5