Link graph: Fix tooltips with vertical link graph lines

See: https://github.com/OpenTTD/OpenTTD/issues/10522
This commit is contained in:
Jonathan G Rennison
2023-02-28 18:59:48 +00:00
parent 3e4ae68075
commit 467b20f5e2

View File

@@ -514,6 +514,8 @@ bool LinkGraphOverlay::ShowTooltip(Point pt, TooltipCloseCondition close_cond)
if ((link.Usage() > 0 || (_ctrl_pressed && link.capacity > 0)) &&
pt.x + 2 >= std::min(pta.x, ptb.x) &&
pt.x - 2 <= std::max(pta.x, ptb.x) &&
pt.y + 2 >= std::min(pta.y, ptb.y) &&
pt.y - 2 <= std::max(pta.y, ptb.y) &&
check_distance()) {
static char buf[1024];