Skip to content

Commit

Permalink
make bordered text less thick
Browse files Browse the repository at this point in the history
  • Loading branch information
Wyvest committed Dec 19, 2023
1 parent e2250d7 commit 035e977
Showing 1 changed file with 9 additions and 14 deletions.
23 changes: 9 additions & 14 deletions src/main/java/cc/polyfrost/oneconfig/renderer/TextRenderer.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,28 +39,23 @@ public static int drawBorderedText(String text, float x, float y, int color, int
String noColors = regex.matcher(text).replaceAll("\u00A7r");
drawingBorder = true;
int yes = 0;
if (opacity > 3) {
int xOff = -3;
while (xOff < 3) {
xOff++;
int yOff = -3;
while (yOff < 3) {
yOff++;
if (opacity / 4 > 3) {
for (int xOff = -2; xOff <= 2; xOff++) {
for (int yOff = -2; yOff <= 2; yOff++) {
if (xOff * xOff != yOff * yOff) {
yes +=
Platform.getGLPlatform().drawText(
noColors, (xOff / 2f) + x, (yOff / 2f) + y, (opacity) << 24, false
);
yes += Platform.getGLPlatform().drawText(
noColors, (xOff / 2f) + x, (yOff / 2f) + y, (opacity / 4) << 24, false
);
}
}
}
}
yes += Platform.getGLPlatform().drawText(text, x, y, color, false);
yes += (int) Platform.getGLPlatform().drawText(text, x, y, color, false);
drawingBorder = false;
return yes;
}

public static float getStringWidth(String text){
public static float getStringWidth(String text) {
return Platform.getGLPlatform().getStringWidth(text);
}

Expand All @@ -75,7 +70,7 @@ public static void drawScaledString(String text, float x, float y, int color, Te
Platform.getGLPlatform().drawText(text, x * (1 / scale), y * (1 / scale), color, true);
break;
case FULL:
drawBorderedText(text, x * (1 / scale), y * (1 / scale), color, 100);
drawBorderedText(text, x * (1 / scale), y * (1 / scale), color, 255);
break;
}
UGraphics.GL.popMatrix();
Expand Down

0 comments on commit 035e977

Please sign in to comment.