From 3626a9e4ccdc0ce95fce684fd3e77d6f2f7721b1 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Sat, 6 Jan 2024 09:10:26 +0100 Subject: [PATCH] SVG_PLOTTER: Update brush color also when the alpha value has changed. Previously, the alpha value change was not tested, so the SVG style was not always updated. Fixes #16530 https://gitlab.com/kicad/code/kicad/-/issues/16530 --- common/plotters/SVG_plotter.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/common/plotters/SVG_plotter.cpp b/common/plotters/SVG_plotter.cpp index 44d46486a4..045070c7a7 100644 --- a/common/plotters/SVG_plotter.cpp +++ b/common/plotters/SVG_plotter.cpp @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2020 Jean-Pierre Charras, jp.charras at wanadoo.fr - * Copyright (C) 1992-2023 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 1992-2024 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -167,11 +167,11 @@ SVG_PLOTTER::SVG_PLOTTER() m_graphics_changed = true; SetTextMode( PLOT_TEXT_MODE::STROKE ); m_fillMode = FILL_T::NO_FILL; // or FILLED_SHAPE or FILLED_WITH_BG_BODYCOLOR - m_pen_rgb_color = 0; // current color value (black) - m_brush_rgb_color = 0; // current color value (black) + m_pen_rgb_color = 0; // current color value (black) + m_brush_rgb_color = 0; // current color value with alpha(black) m_brush_alpha = 1.0; m_dashed = LINE_STYLE::SOLID; - m_precision = 4; // default: 4 digits in mantissa. + m_precision = 4; // default: 4 digits in mantissa. } @@ -347,7 +347,7 @@ void SVG_PLOTTER::emitSetRGBColor( double r, double g, double b, double a ) int blue = (int) ( 255.0 * b ); long rgb_color = (red << 16) | (green << 8) | blue; - if( m_pen_rgb_color != rgb_color ) + if( m_pen_rgb_color != rgb_color || m_brush_alpha != a ) { m_graphics_changed = true; m_pen_rgb_color = rgb_color;