Skip to content

Commit

Permalink
Respect top tooltip shadow when adjusting the tooltip position for th…
Browse files Browse the repository at this point in the history
…e pointer location.
  • Loading branch information
weisJ committed Feb 23, 2021
1 parent 770be70 commit 86d1c31
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -601,14 +601,17 @@ private Point adjustPoint(final Point p, final Alignment align, final Dimension
if (b instanceof AlignableTooltipBorder) {
AlignableTooltipBorder border = (AlignableTooltipBorder) b;
int factor = outside ? 1 : -1;
int pointerDist = border.getDistanceToPointer();
if (align == Alignment.EAST) {
p.x -= factor * border.getDistanceToPointer();
p.x -= factor * pointerDist;
p.y -= factor * pointerDist;
} else if (align == Alignment.WEST) {
p.x += factor * border.getDistanceToPointer();
p.x += factor * pointerDist;
p.y -= factor * pointerDist;
} else if (align.isNorth()) {
p.y += factor * border.getDistanceToPointer();
p.y += factor * pointerDist;
} else if (align.isSouth()) {
p.y -= factor * border.getDistanceToPointer();
p.y -= factor * pointerDist;
}
if (align.isEast(false)) {
p.x -= factor * border.getPointerOffset(toolTip, dim, factor);
Expand Down

0 comments on commit 86d1c31

Please sign in to comment.