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
This commit is contained in:
jean-pierre charras 2024-01-06 09:10:26 +01:00
parent be21c689e8
commit 3626a9e4cc
1 changed files with 5 additions and 5 deletions

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application. * 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) 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 * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
@ -168,7 +168,7 @@ SVG_PLOTTER::SVG_PLOTTER()
SetTextMode( PLOT_TEXT_MODE::STROKE ); SetTextMode( PLOT_TEXT_MODE::STROKE );
m_fillMode = FILL_T::NO_FILL; // or FILLED_SHAPE or FILLED_WITH_BG_BODYCOLOR m_fillMode = FILL_T::NO_FILL; // or FILLED_SHAPE or FILLED_WITH_BG_BODYCOLOR
m_pen_rgb_color = 0; // current color value (black) m_pen_rgb_color = 0; // current color value (black)
m_brush_rgb_color = 0; // current color value (black) m_brush_rgb_color = 0; // current color value with alpha(black)
m_brush_alpha = 1.0; m_brush_alpha = 1.0;
m_dashed = LINE_STYLE::SOLID; 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 ); int blue = (int) ( 255.0 * b );
long rgb_color = (red << 16) | (green << 8) | blue; 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_graphics_changed = true;
m_pen_rgb_color = rgb_color; m_pen_rgb_color = rgb_color;