NanoSVG does handle opacity (thanks Mark) but the check needs to be
unsigned if we are comparing the resulting down-shifted value against
zero

Fixes https://gitlab.com/kicad/code/kicad/issues/13033
This commit is contained in:
Seth Hillbrand 2022-11-29 11:20:12 -08:00
parent 3ac43fb9dc
commit 0ee7f8e2bd
1 changed files with 7 additions and 1 deletions

View File

@ -73,10 +73,16 @@ bool SVG_IMPORT_PLUGIN::Load( const wxString& aFileName )
bool SVG_IMPORT_PLUGIN::Import()
{
auto alpha =
[]( unsigned int color )
{
return color >> 24;
};
for( NSVGshape* shape = m_parsedImage->shapes; shape != nullptr; shape = shape->next )
{
double lineWidth = shape->strokeWidth;
bool filled = shape->fill.type != NSVG_PAINT_NONE;
bool filled = shape->fill.type != NSVG_PAINT_NONE && alpha( shape->fill.color ) > 0;
GRAPHICS_IMPORTER::POLY_FILL_RULE rule = GRAPHICS_IMPORTER::PF_NONZERO;