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
I don't know much about SVG format but at SVGParser:1001 the code looks for attributes width and height while I used this SVG file which has a viewBox attribute with those measures.
So, I changed that code with:
if (localName.equals("svg")) {
Float w = getFloatAttr("width", atts);
Float h = getFloatAttr("height", atts);
if (w == null || h == null)
{
String vb = getStringAttr("viewBox", atts);
if (vb == null) {
throw new RuntimeException("Can't find size attributes: width+height or viewBox");
}
String[] measures = vb.split(" ");
w = Float.parseFloat(measures[2]);
h = Float.parseFloat(measures[3]);
}
int width = (int) Math.ceil(w);
int height = (int) Math.ceil(h);
canvas = picture.beginRecording(width, height);
Thanks for the lib!
The text was updated successfully, but these errors were encountered:
I don't know much about SVG format but at SVGParser:1001 the code looks for attributes
width
andheight
while I used this SVG file which has aviewBox
attribute with those measures.So, I changed that code with:
Thanks for the lib!
The text was updated successfully, but these errors were encountered: