From 87f4d37de379da391fc4478161fcec66824a48c8 Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Fri, 3 Mar 2023 22:37:17 +0000 Subject: [PATCH] Fix #10522: Link graph line tooltip test for vertical lines (#10524) --- src/linkgraph/linkgraph_gui.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/linkgraph/linkgraph_gui.cpp b/src/linkgraph/linkgraph_gui.cpp index 73cdf9ba48..026f85b853 100644 --- a/src/linkgraph/linkgraph_gui.cpp +++ b/src/linkgraph/linkgraph_gui.cpp @@ -373,8 +373,10 @@ bool LinkGraphOverlay::ShowTooltip(Point pt, TooltipCloseCondition close_cond) std::sqrt((ptb.x - pta.x) * (ptb.x - pta.x) + (ptb.y - pta.y) * (ptb.y - pta.y)); const auto &link = j->second; if (dist <= 4 && link.Usage() > 0 && - pt.x >= std::min(pta.x, ptb.x) && - pt.x <= std::max(pta.x, ptb.x)) { + 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)) { static char buf[1024]; char *buf_end = buf; buf[0] = 0;