Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
zeng-github01 committed Nov 8, 2024
1 parent f868343 commit ea0bbf7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,10 @@ protected void addButtons() {
}

protected void addLabel() {
this.lockReason = new GuiImgLabel(this.fontRenderer, guiLeft + 50, guiTop + 12, Settings.UNLOCK, LockCraftingMode.NONE);
this.lockReason = new GuiImgLabel(this.fontRenderer, guiLeft + 40, guiTop + 12, Settings.UNLOCK, LockCraftingMode.NONE);
labelList.add(lockReason);
}


@Override
public void drawFG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
if (this.BlockMode != null) {
Expand Down
8 changes: 5 additions & 3 deletions src/main/java/appeng/client/gui/widgets/GuiImgLabel.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ public void drawLabel(Minecraft mc, int mouseX, int mouseY) {

if (labelSetting != null && currentValue != null) {
LabelAppearance labelAppearance = appearances.get(new GuiImgButton.EnumPair(this.labelSetting, this.currentValue));
fontRenderer.drawString(I18n.translateToLocal(labelAppearance.displayLabel), x + 16, y + 5, labelAppearance.color);
String translated = I18n.translateToLocal(labelAppearance.displayLabel);
fontRenderer.drawString(translated, x + 16, y + 5, labelAppearance.color);
width = 16 + fontRenderer.getStringWidth(translated);
}
}
}
Expand Down Expand Up @@ -118,12 +120,12 @@ public int yPos() {

@Override
public int getWidth() {
return 16;
return width;
}

@Override
public int getHeight() {
return 16;
return height;
}

@Override
Expand Down

0 comments on commit ea0bbf7

Please sign in to comment.