aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/io/github/cottonmc/cotton/gui/client/ScreenDrawing.java4
-rw-r--r--src/main/java/io/github/cottonmc/cotton/gui/widget/data/Texture.java2
2 files changed, 4 insertions, 2 deletions
diff --git a/src/main/java/io/github/cottonmc/cotton/gui/client/ScreenDrawing.java b/src/main/java/io/github/cottonmc/cotton/gui/client/ScreenDrawing.java
index 6ddc9c0..9332bef 100644
--- a/src/main/java/io/github/cottonmc/cotton/gui/client/ScreenDrawing.java
+++ b/src/main/java/io/github/cottonmc/cotton/gui/client/ScreenDrawing.java
@@ -132,8 +132,8 @@ public class ScreenDrawing {
if (Float.isInfinite(fullWidth) || Float.isInfinite(fullHeight)) break outer;
// Calculate the offset left/top coordinates.
- int xo = x - (int) (fullWidth * texture.u1());
- int yo = y - (int) (fullHeight * texture.v1());
+ float xo = x - fullWidth * Math.min(texture.u1(), texture.u2());
+ float yo = y - fullHeight * Math.min(texture.v1(), texture.v2());
MatrixStack matrices = context.getMatrices();
matrices.push();
diff --git a/src/main/java/io/github/cottonmc/cotton/gui/widget/data/Texture.java b/src/main/java/io/github/cottonmc/cotton/gui/widget/data/Texture.java
index 5418c70..47b296f 100644
--- a/src/main/java/io/github/cottonmc/cotton/gui/widget/data/Texture.java
+++ b/src/main/java/io/github/cottonmc/cotton/gui/widget/data/Texture.java
@@ -45,6 +45,8 @@ import java.util.Objects;
* and they need to be drawn with specific {@code Texture}-accepting methods
* or {@link net.minecraft.client.gui.DrawContext}.
*
+ * <p>GUI sprite textures don't currently support flipping the texture by flipping UV coordinates.
+ *
* @param image the image of this texture
* @param type the type of this texture
* @param u1 the start U-coordinate, between 0 and 1