Browse Source

Fix 436f95e02e

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
7.0
Seth Hillbrand 3 years ago
parent
commit
0ee7f8e2bd
  1. 8
      pcbnew/import_gfx/svg_import_plugin.cpp

8
pcbnew/import_gfx/svg_import_plugin.cpp

@ -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;

Loading…
Cancel
Save