aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/shedaniel/rei/gui/widget/ButtonWidget.java
diff options
context:
space:
mode:
authorshedaniel <daniel@shedaniel.me>2020-03-10 02:45:09 +0800
committershedaniel <daniel@shedaniel.me>2020-03-10 02:45:09 +0800
commit0ef7d4d944b0683250f905f856c08e759ae9355d (patch)
tree88376b527c5c86fd24c0bf2b6ad4f740d20cc4d0 /src/main/java/me/shedaniel/rei/gui/widget/ButtonWidget.java
parent5c83be1590d4e1ea706ab7b57d20253f95dcbd1b (diff)
downloadRoughlyEnoughItems-0ef7d4d944b0683250f905f856c08e759ae9355d.tar.gz
RoughlyEnoughItems-0ef7d4d944b0683250f905f856c08e759ae9355d.tar.bz2
RoughlyEnoughItems-0ef7d4d944b0683250f905f856c08e759ae9355d.zip
ScreenWithHandler refractor, why must we suffer
Signed-off-by: shedaniel <daniel@shedaniel.me>
Diffstat (limited to 'src/main/java/me/shedaniel/rei/gui/widget/ButtonWidget.java')
-rw-r--r--src/main/java/me/shedaniel/rei/gui/widget/ButtonWidget.java20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/main/java/me/shedaniel/rei/gui/widget/ButtonWidget.java b/src/main/java/me/shedaniel/rei/gui/widget/ButtonWidget.java
index 0fd86752d..9f9614b53 100644
--- a/src/main/java/me/shedaniel/rei/gui/widget/ButtonWidget.java
+++ b/src/main/java/me/shedaniel/rei/gui/widget/ButtonWidget.java
@@ -122,19 +122,19 @@ public abstract class ButtonWidget extends WidgetWithBounds {
RenderSystem.blendFuncSeparate(770, 771, 1, 0);
RenderSystem.blendFunc(770, 771);
//Four Corners
- blit(x, y, getBlitOffset(), 0, textureOffset * 80, 4, 4, 512, 256);
- blit(x + width - 4, y, getBlitOffset(), 252, textureOffset * 80, 4, 4, 512, 256);
- blit(x, y + height - 4, getBlitOffset(), 0, textureOffset * 80 + 76, 4, 4, 512, 256);
- blit(x + width - 4, y + height - 4, getBlitOffset(), 252, textureOffset * 80 + 76, 4, 4, 512, 256);
+ blit(x, y, getZOffset(), 0, textureOffset * 80, 4, 4, 512, 256);
+ blit(x + width - 4, y, getZOffset(), 252, textureOffset * 80, 4, 4, 512, 256);
+ blit(x, y + height - 4, getZOffset(), 0, textureOffset * 80 + 76, 4, 4, 512, 256);
+ blit(x + width - 4, y + height - 4, getZOffset(), 252, textureOffset * 80 + 76, 4, 4, 512, 256);
//Sides
- blit(x + 4, y, getBlitOffset(), 4, textureOffset * 80, MathHelper.ceil((width - 8) / 2f), 4, 512, 256);
- blit(x + 4, y + height - 4, getBlitOffset(), 4, textureOffset * 80 + 76, MathHelper.ceil((width - 8) / 2f), 4, 512, 256);
- blit(x + 4 + MathHelper.ceil((width - 8) / 2f), y + height - 4, getBlitOffset(), 252 - MathHelper.floor((width - 8) / 2f), textureOffset * 80 + 76, MathHelper.floor((width - 8) / 2f), 4, 512, 256);
- blit(x + 4 + MathHelper.ceil((width - 8) / 2f), y, getBlitOffset(), 252 - MathHelper.floor((width - 8) / 2f), textureOffset * 80, MathHelper.floor((width - 8) / 2f), 4, 512, 256);
+ blit(x + 4, y, getZOffset(), 4, textureOffset * 80, MathHelper.ceil((width - 8) / 2f), 4, 512, 256);
+ blit(x + 4, y + height - 4, getZOffset(), 4, textureOffset * 80 + 76, MathHelper.ceil((width - 8) / 2f), 4, 512, 256);
+ blit(x + 4 + MathHelper.ceil((width - 8) / 2f), y + height - 4, getZOffset(), 252 - MathHelper.floor((width - 8) / 2f), textureOffset * 80 + 76, MathHelper.floor((width - 8) / 2f), 4, 512, 256);
+ blit(x + 4 + MathHelper.ceil((width - 8) / 2f), y, getZOffset(), 252 - MathHelper.floor((width - 8) / 2f), textureOffset * 80, MathHelper.floor((width - 8) / 2f), 4, 512, 256);
for (int i = y + 4; i < y + height - 4; i += 76) {
- blit(x, i, getBlitOffset(), 0, 4 + textureOffset * 80, MathHelper.ceil(width / 2f), MathHelper.clamp(y + height - 4 - i, 0, 76), 512, 256);
- blit(x + MathHelper.ceil(width / 2f), i, getBlitOffset(), 256 - MathHelper.floor(width / 2f), 4 + textureOffset * 80, MathHelper.floor(width / 2f), MathHelper.clamp(y + height - 4 - i, 0, 76), 512, 256);
+ blit(x, i, getZOffset(), 0, 4 + textureOffset * 80, MathHelper.ceil(width / 2f), MathHelper.clamp(y + height - 4 - i, 0, 76), 512, 256);
+ blit(x + MathHelper.ceil(width / 2f), i, getZOffset(), 256 - MathHelper.floor(width / 2f), 4 + textureOffset * 80, MathHelper.floor(width / 2f), MathHelper.clamp(y + height - 4 - i, 0, 76), 512, 256);
}
}