Skip to content

Commit

Permalink
Add warning
Browse files Browse the repository at this point in the history
  • Loading branch information
dnfield committed Mar 31, 2019
1 parent b1d4e0b commit 2a13746
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/src/svg/parser_state.dart
Original file line number Diff line number Diff line change
Expand Up @@ -639,6 +639,12 @@ class SvgParserState {
if (event is XmlStartElementEvent) {
if (getAttribute(event.attributes, 'display') == 'none' ||
getAttribute(event.attributes, 'visibility') == 'hidden') {
print('SVG Warning: Discarding:\n\n $event\n\n'
'and any children it has since it is not visible.\n'
'If that element is meant to be visible, the `display` or '
'`visibility` attributes should be removed.\n'
'If that element is not meant to be visible, it would be better '
'to remove it from the SVG file.');
if (!event.isSelfClosing) {
depth += 1;
_discardSubtree();
Expand Down

0 comments on commit 2a13746

Please sign in to comment.