Skip to content

Commit

Permalink
[1.20.4] Fix ModListScreen link detection (#545)
Browse files Browse the repository at this point in the history
  • Loading branch information
XFactHD authored Jan 25, 2024
1 parent d5e4e6d commit 339fed9
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -207,20 +207,20 @@ private Style findTextLine(final int mouseX, final int mouseY) {
if (!isMouseOver(mouseX, mouseY))
return null;

double offset = (mouseY - top) + border + scrollDistance + 1;
double offset = (mouseY - top - PADDING - border) + scrollDistance;
if (logoPath != null) {
offset -= 50;
}
if (offset <= 0)
return null;

int lineIdx = (int) (offset / font.lineHeight);
if (lineIdx >= lines.size() || lineIdx < 1)
if (lineIdx >= lines.size() || lineIdx < 0)
return null;

FormattedCharSequence line = lines.get(lineIdx - 1);
FormattedCharSequence line = lines.get(lineIdx);
if (line != null) {
return font.getSplitter().componentStyleAtWidth(line, mouseX - left - border);
return font.getSplitter().componentStyleAtWidth(line, mouseX - left - border - 1);
}
return null;
}
Expand Down

0 comments on commit 339fed9

Please sign in to comment.