aboutsummaryrefslogtreecommitdiff
path: root/runtime/src
diff options
context:
space:
mode:
authorshedaniel <daniel@shedaniel.me>2022-06-26 04:09:06 +0800
committershedaniel <daniel@shedaniel.me>2022-06-26 04:09:06 +0800
commitf4ec48ad1539bdc0ea5f54931740adf4bcb0560b (patch)
tree71255dcb6ff80c2907702979e7b56f2c01676e82 /runtime/src
parentff93cf4977b66cd8d276b77c8c69404684abe17b (diff)
downloadRoughlyEnoughItems-f4ec48ad1539bdc0ea5f54931740adf4bcb0560b.tar.gz
RoughlyEnoughItems-f4ec48ad1539bdc0ea5f54931740adf4bcb0560b.tar.bz2
RoughlyEnoughItems-f4ec48ad1539bdc0ea5f54931740adf4bcb0560b.zip
Adapt scissors to transform
Diffstat (limited to 'runtime/src')
-rw-r--r--runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/OverflowWidget.java10
1 files changed, 7 insertions, 3 deletions
diff --git a/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/OverflowWidget.java b/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/OverflowWidget.java
index 12cdfcfc9..89fca306e 100644
--- a/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/OverflowWidget.java
+++ b/runtime/src/main/java/me/shedaniel/rei/impl/client/gui/widget/OverflowWidget.java
@@ -32,7 +32,11 @@ import me.shedaniel.clothconfig2.api.scroll.ScrollingContainer;
import me.shedaniel.math.FloatingPoint;
import me.shedaniel.math.Rectangle;
import me.shedaniel.rei.RoughlyEnoughItemsCoreClient;
+import me.shedaniel.rei.api.client.gui.widgets.CloseableScissors;
import me.shedaniel.rei.api.client.gui.widgets.WidgetWithBounds;
+import me.shedaniel.rei.impl.common.util.RectangleUtils;
+
+import java.io.Closeable;
@SuppressWarnings("UnstableApiUsage")
public class OverflowWidget extends DelegateWidgetWithTranslate {
@@ -84,9 +88,9 @@ public class OverflowWidget extends DelegateWidgetWithTranslate {
ScrollingContainer.handleBounceBack(this.velocity.target().y, 0, delta, .0001)
), 20);
- ScissorsHandler.INSTANCE.scissor(this.bounds);
- super.render(poseStack, mouseX, mouseY, delta);
- ScissorsHandler.INSTANCE.removeLastScissor();
+ try (CloseableScissors scissors = scissor(poseStack, this.bounds)) {
+ super.render(poseStack, mouseX, mouseY, delta);
+ }
}
@Override