Fix thaumcraft node aspects overflowing out of the tooltip bounding box (#28)

Co-authored-by: Martin Robertz <[email protected]>
Co-authored-by: Maya <[email protected]>
This commit is contained in:
authored and GitHub committed 2025-03-20 09:40:58 -05:00
1 parent 678bb6dd44
commit 4fb3d1edaa
1 file changed
+14 -3
@@ -134,9 +134,20 @@ public class Tooltip {
// We correct if we only have one column
if (columnsWidth.size() == 1) columnsWidth.set(0, maxStringW);
// We compute the position of the columns to be able to align the renderable later on
for (int i = 1; i < columnsWidth.size(); i++)
columnsPos.set(i, columnsWidth.get(i - 1) + columnsPos.get(i - 1) + TabSpacing);
int tmp = 0;
for (int i = 0; i < columnsWidth.size(); i++) {
tmp += columnsWidth.get(i);
// We compute the position of the columns to be able to align the renderable later on
if (i != 0) {
columnsPos.set(i, columnsWidth.get(i - 1) + columnsPos.get(i - 1) + TabSpacing);
}
}
// We correct for edge cases where the longest string in a column is in a line shorter than the longest line
tmp += TabSpacing * (columnsWidth.size() - 1);
maxStringW = Math.max(maxStringW, tmp);
this.computeRenderables();
this.computePositionAndSize(hasIcon);