Skip to content

Commit

Permalink
Fix visibility of hidden layers in SVG for Inkscape
Browse files Browse the repository at this point in the history
  • Loading branch information
mthh committed May 11, 2023
1 parent eebc3b8 commit 0019878
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions client/js/map_export.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,13 @@ function patchSvgForInkscape() {
elems[i].setAttribute('inkscape:label', elems[i].id);
}
elems[i].setAttribute('inkscape:groupmode', 'layer');

if (elems[i].style.visibility === 'hidden') {
// Currently inkscape doesn't support the visibility attribute nor the visibility CSS property
// (it looks like it's a bug or regression on Inkscape side / see notably https://gitlab.com/inkscape/inbox/-/issues/2177)
// so we hide the layer using the display CSS property
elems[i].style.display = 'none';
}
}
}

Expand Down

0 comments on commit 0019878

Please sign in to comment.