# HG changeset patch # User Jonathan G Rennison # Date 2023-03-03 22:37:17 # Node ID 27884ba36eb0dac1a3e654e71cc2f703bdd511a6 # Parent 189134e628cd64ea1e9cd10afafc8b935f0882f2 Fix #10522: Link graph line tooltip test for vertical lines (#10524) diff --git a/src/linkgraph/linkgraph_gui.cpp b/src/linkgraph/linkgraph_gui.cpp --- a/src/linkgraph/linkgraph_gui.cpp +++ b/src/linkgraph/linkgraph_gui.cpp @@ -373,8 +373,10 @@ bool LinkGraphOverlay::ShowTooltip(Point 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;