diff options
author | Juuz <6596629+Juuxel@users.noreply.github.com> | 2023-06-11 13:44:58 +0300 |
---|---|---|
committer | Juuz <6596629+Juuxel@users.noreply.github.com> | 2023-06-11 13:44:58 +0300 |
commit | 72b670a3b4f682fc131eb58d4c39d38330bbd6f7 (patch) | |
tree | d368444b697e057fd1fdf9ceaa962f255b6b217c /src/main/java | |
parent | 8eb600e9c6e3e722f243fc540c887309ce4c9d1c (diff) | |
download | LibGui-72b670a3b4f682fc131eb58d4c39d38330bbd6f7.tar.gz LibGui-72b670a3b4f682fc131eb58d4c39d38330bbd6f7.tar.bz2 LibGui-72b670a3b4f682fc131eb58d4c39d38330bbd6f7.zip |
Fix incorrect title positions for non-left alignments
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/io/github/cottonmc/cotton/gui/client/CottonClientScreen.java | 2 | ||||
-rw-r--r-- | src/main/java/io/github/cottonmc/cotton/gui/client/CottonInventoryScreen.java | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/main/java/io/github/cottonmc/cotton/gui/client/CottonClientScreen.java b/src/main/java/io/github/cottonmc/cotton/gui/client/CottonClientScreen.java index 81d7646..0df0597 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/client/CottonClientScreen.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/client/CottonClientScreen.java @@ -139,7 +139,7 @@ public class CottonClientScreen extends Screen implements CottonScreenImpl { if (getTitle() != null && description.isTitleVisible()) { int width = description.getRootPanel().getWidth(); - ScreenDrawing.drawString(matrices, getTitle().asOrderedText(), description.getTitleAlignment(), left + titleX, top + titleY, width - titleX, description.getTitleColor()); + ScreenDrawing.drawString(matrices, getTitle().asOrderedText(), description.getTitleAlignment(), left + titleX, top + titleY, width - 2 * titleX, description.getTitleColor()); } } } diff --git a/src/main/java/io/github/cottonmc/cotton/gui/client/CottonInventoryScreen.java b/src/main/java/io/github/cottonmc/cotton/gui/client/CottonInventoryScreen.java index 61fc287..013856d 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/client/CottonInventoryScreen.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/client/CottonInventoryScreen.java @@ -314,7 +314,7 @@ public class CottonInventoryScreen<T extends SyncedGuiDescription> extends Handl protected void drawForeground(MatrixStack matrices, int mouseX, int mouseY) { if (description != null && description.isTitleVisible()) { int width = description.getRootPanel().getWidth(); - ScreenDrawing.drawString(matrices, getTitle().asOrderedText(), description.getTitleAlignment(), titleX, titleY, width - titleX, description.getTitleColor()); + ScreenDrawing.drawString(matrices, getTitle().asOrderedText(), description.getTitleAlignment(), titleX, titleY, width - 2 * titleX, description.getTitleColor()); } // Don't draw the player inventory label as it's drawn by the widget itself |