Skip to content

Commit

Permalink
Finish Outlines
Browse files Browse the repository at this point in the history
  • Loading branch information
machiecodes committed Jan 6, 2025
1 parent 65d9e68 commit 76ee39c
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -292,14 +292,6 @@ private void renderModule(HudRenderer renderer, int index, double x, double y) {
renderer.quad(x - 2 - outlineWidth.get(), lineStartY,
textLength + 4 + 2 * outlineWidth.get(),
outlineWidth.get(), prevColor, prevColor, color, color);
}

if (index == modules.size() - 1) { // Render bottom quad for last item in list
lineHeight += 2;

renderer.quad(x - 2 - outlineWidth.get(), lineStartY + lineHeight,
textLength + 4 + 2 * outlineWidth.get(), outlineWidth.get(),
prevColor, prevColor, color, color);
} else { // Otherwise render the inbetween quads that connect each side quad
renderer.quad(Math.min(prevX, x) - 2 - outlineWidth.get(), Math.max(prevX, x) == x ? y : y - outlineWidth.get(),
(Math.max(prevX, x) - 2) - (Math.min(prevX, x) - 2 - outlineWidth.get()), outlineWidth.get(),
Expand All @@ -310,6 +302,14 @@ private void renderModule(HudRenderer renderer, int index, double x, double y) {
prevColor, prevColor, color, color); // Right inbetween quad
}

if (index == modules.size() - 1) { // Render bottom quad for last item in list
lineHeight += 2;

renderer.quad(x - 2 - outlineWidth.get(), lineStartY + lineHeight,
textLength + 4 + 2 * outlineWidth.get(), outlineWidth.get(),
prevColor, prevColor, color, color);
}

// Left side quad
renderer.quad(x - 2 - outlineWidth.get(), lineStartY, outlineWidth.get(), lineHeight,
prevColor, prevColor, color, color);
Expand Down

0 comments on commit 76ee39c

Please sign in to comment.