From c25d9f5c81524b2eaeaa35fe4ae58451b4f367af Mon Sep 17 00:00:00 2001 From: Richard Wheeler <2762690+zephyris@users.noreply.github.com> Date: Sat, 24 Feb 2024 00:04:34 +0000 Subject: [PATCH] Fix: Make link graph node borders scale with GUI (#12167) --- src/linkgraph/linkgraph_gui.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/linkgraph/linkgraph_gui.cpp b/src/linkgraph/linkgraph_gui.cpp index a1dfa0c8a8..0bd7f2d947 100644 --- a/src/linkgraph/linkgraph_gui.cpp +++ b/src/linkgraph/linkgraph_gui.cpp @@ -341,7 +341,7 @@ void LinkGraphOverlay::DrawStationDots(const DrawPixelInfo *dpi) const * Draw a square symbolizing a producer of cargo. * @param x X coordinate of the middle of the vertex. * @param y Y coordinate of the middle of the vertex. - * @param size Y and y extend of the vertex. + * @param size x and y extent of the vertex. * @param colour Colour with which the vertex will be filled. * @param border_colour Colour for the border of the vertex. */ @@ -350,15 +350,10 @@ void LinkGraphOverlay::DrawStationDots(const DrawPixelInfo *dpi) const size--; int w1 = size / 2; int w2 = size / 2 + size % 2; + int borderwidth = ScaleGUITrad(1); + GfxFillRect(x - w1 - borderwidth, y - w1 - borderwidth, x + w2 + borderwidth, y + w2 + borderwidth, border_colour); GfxFillRect(x - w1, y - w1, x + w2, y + w2, colour); - - w1++; - w2++; - GfxDrawLine(x - w1, y - w1, x + w2, y - w1, border_colour); - GfxDrawLine(x - w1, y + w2, x + w2, y + w2, border_colour); - GfxDrawLine(x - w1, y - w1, x - w1, y + w2, border_colour); - GfxDrawLine(x + w2, y - w1, x + w2, y + w2, border_colour); } bool LinkGraphOverlay::ShowTooltip(Point pt, TooltipCloseCondition close_cond)