SVG import: skip invisible shapes.

This commit is contained in:
Alex Shvartzkop 2023-09-07 03:50:00 +03:00
parent 2c07866fff
commit 024622b0f6
1 changed files with 3 additions and 0 deletions

View File

@ -104,6 +104,9 @@ bool SVG_IMPORT_PLUGIN::Import()
for( NSVGshape* shape = m_parsedImage->shapes; shape != nullptr; shape = shape->next ) for( NSVGshape* shape = m_parsedImage->shapes; shape != nullptr; shape = shape->next )
{ {
if( !( shape->flags & NSVG_FLAGS_VISIBLE ) )
continue;
double lineWidth = shape->stroke.type != NSVG_PAINT_NONE ? shape->strokeWidth : -1; double lineWidth = shape->stroke.type != NSVG_PAINT_NONE ? shape->strokeWidth : -1;
bool filled = shape->fill.type != NSVG_PAINT_NONE && alpha( shape->fill.color ) > 0; bool filled = shape->fill.type != NSVG_PAINT_NONE && alpha( shape->fill.color ) > 0;