From 467b20f5e2a5c1978db3a7387d5c466b3cc7db8a Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Tue, 28 Feb 2023 18:59:48 +0000 Subject: [PATCH] Link graph: Fix tooltips with vertical link graph lines See: https://github.com/OpenTTD/OpenTTD/issues/10522 --- src/linkgraph/linkgraph_gui.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/linkgraph/linkgraph_gui.cpp b/src/linkgraph/linkgraph_gui.cpp index 1420b52e14..45a90d5261 100644 --- a/src/linkgraph/linkgraph_gui.cpp +++ b/src/linkgraph/linkgraph_gui.cpp @@ -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];