mirror of
https://github.com/KAMKEEL/CustomNPC-Plus.git
synced 2026-11-19 14:19:13 +00:00
Fixed hover bug
This commit is contained in:
1 parent
0a42ea6d57
commit
d762f21c54
1 file changed
+4
-3
+4
-3
@@ -175,12 +175,13 @@ public class TokenHoverRenderer {
|
||||
|
||||
// Mouse-over detection bounds:
|
||||
// When dragged, use panel rect only — no gap extension (token is unrelated to panel position)
|
||||
// When default, extend downward to cover the gap between token bottom and tooltip top
|
||||
// When default, union the token bottom and the tooltip rect so both directions are covered
|
||||
if (hoverState.hasOverriddenPosition()) {
|
||||
hoverState.setTooltipBounds(tooltipX, tooltipY, boxWidth, boxHeight);
|
||||
} else {
|
||||
int boundsTopY = Math.min(tokenY + lineHeight, tooltipY);
|
||||
hoverState.setTooltipBounds(tooltipX, boundsTopY, boxWidth, tooltipY - boundsTopY + boxHeight);
|
||||
int boundsTopY = Math.min(tokenY + lineHeight, tooltipY);
|
||||
int boundsBottomY = Math.max(tooltipY + boxHeight, tokenY + lineHeight);
|
||||
hoverState.setTooltipBounds(tooltipX, boundsTopY, boxWidth, boundsBottomY - boundsTopY);
|
||||
}
|
||||
|
||||
// Render the tooltip
|
||||
|
||||
Reference in new issue
Block a user