Skip to content

Commit e0f7553

Browse files
committed
Fix scissoring
1 parent 098fb7b commit e0f7553

File tree

3 files changed

+2
-11
lines changed

3 files changed

+2
-11
lines changed

api/src/main/java/me/shedaniel/rei/api/client/favorites/CompoundFavoriteRenderer.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
import net.fabricmc.api.Environment;
3333
import net.minecraft.Util;
3434
import net.minecraft.client.gui.GuiGraphics;
35-
import org.joml.Vector4f;
3635

3736
import java.util.List;
3837
import java.util.function.IntFunction;
@@ -90,12 +89,7 @@ public CompoundFavoriteRenderer(boolean showcase, int count, IntFunction<Rendere
9089
@Override
9190
public void render(GuiGraphics graphics, Rectangle bounds, int mouseX, int mouseY, float delta) {
9291
updateAnimator(delta);
93-
Vector4f vector4f = new Vector4f(bounds.x, bounds.y, 0, 1.0F);
94-
graphics.pose().last().pose().transform(vector4f);
95-
Vector4f vector4f2 = new Vector4f(bounds.getMaxX(), bounds.getMaxY(), 0, 1.0F);
96-
graphics.pose().last().pose().transform(vector4f2);
97-
scissorArea.setBounds((int) vector4f.x(), (int) vector4f.y(), (int) vector4f2.x() - (int) vector4f.x(), (int) vector4f2.y() - (int) vector4f.y());
98-
graphics.enableScissor(scissorArea.x, scissorArea.y, scissorArea.getMaxX(), scissorArea.getMaxY());
92+
graphics.enableScissor(bounds.x, bounds.y, bounds.getMaxX(), bounds.getMaxY());
9993
graphics.pose().pushPose();
10094
graphics.pose().translate(0, this.offset.floatValue() * -bounds.getHeight(), 0);
10195
for (int i = 0; i < count; i++) {

api/src/main/java/me/shedaniel/rei/api/client/gui/widgets/Widget.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
import me.shedaniel.math.impl.PointHelper;
3030
import me.shedaniel.rei.api.client.gui.AbstractContainerEventHandler;
3131
import me.shedaniel.rei.api.client.gui.Renderer;
32-
import me.shedaniel.rei.api.client.util.MatrixUtils;
3332
import net.fabricmc.api.EnvType;
3433
import net.fabricmc.api.Environment;
3534
import net.minecraft.client.Minecraft;
@@ -119,7 +118,6 @@ public double getZRenderingPriority() {
119118

120119
@ApiStatus.Experimental
121120
public static CloseableScissors scissor(GuiGraphics graphics, Rectangle bounds) {
122-
bounds = MatrixUtils.transform(graphics.pose().last().pose(), bounds);
123121
graphics.enableScissor(bounds.x, bounds.y, bounds.getMaxX(), bounds.getMaxY());
124122
return graphics::disableScissor;
125123
}

runtime/src/main/java/me/shedaniel/rei/impl/client/gui/config/components/ConfigOptionWidget.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
import me.shedaniel.rei.api.client.gui.widgets.Widget;
3232
import me.shedaniel.rei.api.client.gui.widgets.WidgetWithBounds;
3333
import me.shedaniel.rei.api.client.gui.widgets.Widgets;
34-
import me.shedaniel.rei.api.client.util.MatrixUtils;
3534
import me.shedaniel.rei.impl.client.gui.config.ConfigAccess;
3635
import me.shedaniel.rei.impl.client.gui.config.options.AllREIConfigOptions;
3736
import me.shedaniel.rei.impl.client.gui.config.options.CompositeOption;
@@ -127,7 +126,7 @@ public void render(GuiGraphics graphics, int mouseX, int mouseY, float delta) {
127126
this.previewLabel.render(graphics, mouseX, mouseY, delta);
128127

129128
if (this.preview != null && this.previewHeight.value() > 0.1f) {
130-
Rectangle rectangle = MatrixUtils.transform(graphics.pose().last().pose(), new Rectangle(0, 24 + 12 * split.size() - (nextLinePreview ? 0 : 12), width, this.previewHeight.value()));
129+
Rectangle rectangle = new Rectangle(0, 24 + 12 * split.size() - (nextLinePreview ? 0 : 12), width, this.previewHeight.value());
131130
graphics.enableScissor(rectangle.x, rectangle.y, rectangle.getMaxX(), rectangle.getMaxY());
132131
this.previewTranslation = new Matrix4f().translate(0, 12 + 12 * split.size(), 100);
133132
this.preview.render(graphics, mouseX, mouseY, delta);

0 commit comments

Comments
 (0)