You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using stack mode, the most outer svg tag in the result file does not contain a viewBox attribute.
This causes an undesired rendering in Safari (8.0.5), Chrome (42.0.2311.90) and Firefox (37.0.1) (I didn't test IE), when the svg file is included via fragment identifiers in an object tag:
See that <object> does not fill whole <div> by width? Even style="width: 100% on <object>-Tag wouldn't change that.
The solution I've found out till now, is to include the viewBox attribute in the most outer svg of the file in the form:
Attention:
This is a quick fix. I didn't analyze the code base, so I don't know if this is the right place to put this or if there exists already an option for this. That's also the reason why I didn't provide a pull request.
However I can provide one as soon as I get feedback, if this is the right place and this fix is needed.
The text was updated successfully, but these errors were encountered:
thanks for reporting this. To be honest, I probably never really checked using the stack sprite in conjunction with an <object> element. The only reason for skipping the viewBox attribute was to save some bytes — I can't think of any downsides. I'll incorporate it as you suggested. :)
When using stack mode, the most outer svg tag in the result file does not contain a viewBox attribute.
This causes an undesired rendering in Safari (8.0.5), Chrome (42.0.2311.90) and Firefox (37.0.1) (I didn't test IE), when the svg file is included via fragment identifiers in an object tag:
And here a screenshot of Safari:
See that
<object>
does not fill whole<div>
by width? Evenstyle="width: 100%
on<object>
-Tag wouldn't change that.The solution I've found out till now, is to include the viewBox attribute in the most outer svg of the file in the form:
maxWidth
is hereby the maximal width of all included svgs. Same applies formaxHeight
.Again a screenshot in Safari after applying this rule:
I build a quick fix for that, modifying:
lib/svg-sprite/mode/stack.js
. Adding the following lines to the_buildSVG
function will solve that problem:Attention:
This is a quick fix. I didn't analyze the code base, so I don't know if this is the right place to put this or if there exists already an option for this. That's also the reason why I didn't provide a pull request.
However I can provide one as soon as I get feedback, if this is the right place and this fix is needed.
The text was updated successfully, but these errors were encountered: