Skip to content

Commit

Permalink
Make text fields render at the correct size again
Browse files Browse the repository at this point in the history
  • Loading branch information
arm32x committed Dec 28, 2023
1 parent 2d6dbef commit 9255afc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ public void renderButton(DrawContext context, int mouseX, int mouseY, float delt

int textColor = self.isEditable() ? self.getEditableColor() : self.getUneditableColor();
int x = this.getX() + (self.getDrawsBackground() ? 4 : 0) - horizontalScroll;
int y = this.getY() + (self.getDrawsBackground() ? 3 : 0) - verticalScroll;
int y = this.getY() + (self.getDrawsBackground() ? 4 : 0) - verticalScroll;

long timeSinceLastSwitchFocusMs = Util.getMeasuringTimeMs() - self.getLastSwitchFocusTime();
boolean showCursor = isFocused() && timeSinceLastSwitchFocusMs / CURSOR_BLINK_INTERVAL_MS % 2 == 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ public CommandEditor(Screen screen, TextRenderer textRenderer, int x, int y, int

commandField = addSelectableChild(new MultilineTextFieldWidget(
textRenderer,
x + leftPadding + 20 + 1, y + 1,
width - leftPadding - rightPadding - 20 - 2, height - 2,
x + leftPadding + 20, y,
width - leftPadding - rightPadding - 20, height,
Text.translatable("advMode.command")
.append(Text.translatable("commandBlockIDE.narrator.editorIndex", index + 1))
) {
Expand Down Expand Up @@ -241,7 +241,7 @@ public int getY() {
public void setY(int y) {
this.y = y;

commandField.setY(y + 1);
commandField.setY(y);
suggestor.refresh();

}
Expand All @@ -253,7 +253,7 @@ public int getWidth() {
public void setWidth(int width) {
this.width = width;

commandField.setWidth(width - leftPadding - rightPadding - 20 - 2);
commandField.setWidth(width - leftPadding - rightPadding - 20);

suggestor.refresh();
}
Expand All @@ -266,7 +266,7 @@ public void setHeight(int height) {
boolean changed = height != this.height;
this.height = height;

commandField.setHeight(height - 2);
commandField.setHeight(height);

suggestor.refresh();

Expand Down

0 comments on commit 9255afc

Please sign in to comment.