Skip to content

Commit

Permalink
fixed text being offset by 1px
Browse files Browse the repository at this point in the history
  • Loading branch information
kurrycat committed Jul 11, 2023
1 parent 0c38558 commit 336da6c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ public static void drawLines(Collection<Vector2D> points, Color color) {
renderer.ifPresent(renderer2DInterface -> renderer2DInterface.drawLines(points, color));
}

//TODO: fix scissor inside each other
public static void enableScissor(double x, double y, double w, double h) {
Optional<Interface> renderer = Interface.get();
renderer.ifPresent(renderer2DInterface -> renderer2DInterface.enableScissor(x, y, w, h));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ public void render(Vector2D mouse) {
this.getText(),
getDisplayedPos()
.add(getDisplayedSize().div(2))
.add(new Vector2D(0.5, this.getText().toLowerCase().equals(this.getText()) ? 0 : 1))
.add(textOffset),
.add(new Vector2D(0.5D, this.getText().toLowerCase().equals(this.getText()) ? 0 : 1))
.add(textOffset).round(),
!enabled ? disabledTextColor :
isBeingPressed ? pressedTextColor :
textColor,
Expand Down

0 comments on commit 336da6c

Please sign in to comment.