Skip to content

Commit

Permalink
fix: some adjustments to badges
Browse files Browse the repository at this point in the history
  • Loading branch information
UltimatChamp committed Jan 27, 2025
1 parent a314980 commit 4390236
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import org.joml.Matrix4f;

public class HeaderTooltipComponent implements TooltipComponent {
private static final int TEXTURE_SIZE = 24;
private static final int TEXTURE_SIZE = 20;
private static final int ITEM_MODEL_SIZE = 16;
private static final int SPACING = 4;
private final ItemStack stack;
Expand Down Expand Up @@ -42,7 +42,7 @@ public int getWidth(TextRenderer textRenderer) {

for (var displayStack : tab.getDisplayStacks()) {
if (stack.isOf(displayStack.getItem())) {
badgeWidth = textRenderer.getWidth(tab.getDisplayName()) + SPACING * 3 - 2;
badgeWidth = textRenderer.getWidth(tab.getDisplayName()) + SPACING * 2;
identified = true;
break;
}
Expand Down Expand Up @@ -128,11 +128,11 @@ private void drawBadge(TextRenderer textRenderer, Text text, int x, int y, DrawC
int textWidth = textRenderer.getWidth(text);
int textHeight = textRenderer.fontHeight;

int textX = x + getTitleOffset() + textRenderer.getWidth(this.nameText) + SPACING * 2;
int textX = x + getTitleOffset() + textRenderer.getWidth(this.nameText) + SPACING + 2;
int textY = y - textRenderer.fontHeight + SPACING * 2 + 2;

context.fill(
textX - SPACING - 2,
textX - SPACING,
textY - SPACING / 2,
textX + textWidth + SPACING,
textY + textHeight,
Expand All @@ -142,15 +142,15 @@ private void drawBadge(TextRenderer textRenderer, Text text, int x, int y, DrawC
context.drawText(
textRenderer,
text,
textX - 2,
textX,
textY,
0xffffffff,
true
);

drawFrame(
context,
textX - SPACING - 2,
textX - SPACING,
textY - SPACING / 2,
textWidth + SPACING * 2,
textHeight + SPACING,
Expand Down

0 comments on commit 4390236

Please sign in to comment.