aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/me/xmrvizzy
diff options
context:
space:
mode:
authorAaron <51387595+AzureAaron@users.noreply.github.com>2023-03-16 21:08:38 -0400
committerAaron <51387595+AzureAaron@users.noreply.github.com>2023-03-16 21:08:38 -0400
commit0e5477d416b836c36df5dd93979e09b5ec389526 (patch)
treef1b8714a394727e38824008065f2557e278338f0 /src/main/java/me/xmrvizzy
parentd27e15f8f346e9859edf5d034d258462e5a4871c (diff)
downloadSkyblocker-0e5477d416b836c36df5dd93979e09b5ec389526.tar.gz
Skyblocker-0e5477d416b836c36df5dd93979e09b5ec389526.tar.bz2
Skyblocker-0e5477d416b836c36df5dd93979e09b5ec389526.zip
Fix incorrect matrix transformations with selected QuickNav buttons
Diffstat (limited to 'src/main/java/me/xmrvizzy')
-rw-r--r--src/main/java/me/xmrvizzy/skyblocker/skyblock/quicknav/QuickNavButton.java16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/main/java/me/xmrvizzy/skyblocker/skyblock/quicknav/QuickNavButton.java b/src/main/java/me/xmrvizzy/skyblocker/skyblock/quicknav/QuickNavButton.java
index 3317a54f..7e82ecef 100644
--- a/src/main/java/me/xmrvizzy/skyblocker/skyblock/quicknav/QuickNavButton.java
+++ b/src/main/java/me/xmrvizzy/skyblocker/skyblock/quicknav/QuickNavButton.java
@@ -67,11 +67,11 @@ public class QuickNavButton extends ClickableWidget {
this.updateCoordinates();
RenderSystem.setShaderTexture(0, BUTTON_TEXTURE);
RenderSystem.disableDepthTest();
- //Move buttons 1 pixel up
- matrices.push();
- matrices.translate(0f, -1f, 0f);
// render button background
if (!this.toggled) {
+ //Move buttons 1 pixel up if they aren't selected
+ matrices.push();
+ matrices.translate(0f, -1f, 0f);
if (this.index >= 6)
// this.drawTexture(matrices, this.x, this.y + 4, this.u, this.v + 4, this.width, this.height - 4);
this.drawTexture(matrices, this.getX(), this.getY() + 4, this.u, this.v + 4, this.width, this.height - 4);
@@ -79,8 +79,14 @@ public class QuickNavButton extends ClickableWidget {
// this.drawTexture(matrices, this.x, this.y, this.u, this.v, this.width, this.height - 4);
this.drawTexture(matrices, this.getX(), this.getY(), this.u, this.v, this.width, this.height - 4);
// } else this.drawTexture(matrices, this.x, this.y, this.u, this.v, this.width, this.height);
- } else this.drawTexture(matrices, this.getX(), this.getY(), this.u, this.v, this.width, this.height);
- matrices.pop();
+ matrices.pop();
+ } else {
+ matrices.push();
+ //Move the top buttons 2 pixels up if they're selected
+ if (this.index <= 6) matrices.translate(0f, -2f, 0f);
+ this.drawTexture(matrices, this.getX(), this.getY(), this.u, this.v, this.width, this.height);
+ matrices.pop();
+ }
// render button icon
if (!this.toggled) {
if (this.index >= 6)