mirror of
https://github.com/peterosterlund2/droidfish.git
synced 2025-04-26 22:05:41 +02:00
DroidFish: Small optimization in SVGParser. From Leo Mayer.
This commit is contained in:
parent
b88ca87867
commit
12f43e5d0c
@ -3,6 +3,8 @@ package com.larvalabs.svgandroid;
|
|||||||
import android.content.res.AssetManager;
|
import android.content.res.AssetManager;
|
||||||
import android.content.res.Resources;
|
import android.content.res.Resources;
|
||||||
import android.graphics.*;
|
import android.graphics.*;
|
||||||
|
import android.util.FloatMath;
|
||||||
|
|
||||||
import org.xml.sax.Attributes;
|
import org.xml.sax.Attributes;
|
||||||
import org.xml.sax.InputSource;
|
import org.xml.sax.InputSource;
|
||||||
import org.xml.sax.SAXException;
|
import org.xml.sax.SAXException;
|
||||||
@ -1013,8 +1015,8 @@ public class SVGParser {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (localName.equals("svg")) {
|
if (localName.equals("svg")) {
|
||||||
int width = (int) Math.ceil(getFloatAttr("width", atts));
|
int width = (int) FloatMath.ceil(getFloatAttr("width", atts));
|
||||||
int height = (int) Math.ceil(getFloatAttr("height", atts));
|
int height = (int) FloatMath.ceil(getFloatAttr("height", atts));
|
||||||
canvas = picture.beginRecording(width, height);
|
canvas = picture.beginRecording(width, height);
|
||||||
} else if (localName.equals("defs")) {
|
} else if (localName.equals("defs")) {
|
||||||
// Ignore
|
// Ignore
|
||||||
|
Loading…
x
Reference in New Issue
Block a user