Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/1.20.x' into 1.20.x
Browse files Browse the repository at this point in the history
  • Loading branch information
XFactHD committed Jan 25, 2024
2 parents d87f9c4 + 339fed9 commit 1c41643
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 1c41643

Please sign in to comment.