mirror of
https://github.com/Doodle3D/doodle3d-client.git
synced 2024-11-22 09:17:56 +01:00
Fix loading of sketches for wordart.
This commit is contained in:
parent
304657a104
commit
e1206f73d4
@ -17,6 +17,13 @@ var wordFuncs = {
|
||||
shapeLineTo(cx + 20, cy);
|
||||
shapeMoveTo(cx, cy - 20);
|
||||
shapeLineTo(cx, cy + 20);
|
||||
},
|
||||
"stats": function() {
|
||||
var text = "Shape statistics:\nNumber of points: " + _points.length;
|
||||
alert(text);
|
||||
},
|
||||
"pdump": function() {
|
||||
console.log("points array: " + _points);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -67,7 +67,7 @@ function loadFromSvg(svgData) {
|
||||
while (true) {
|
||||
skipSpace();
|
||||
var c = svgData.charAt(p);
|
||||
if (c == 'M' || c == 'm' || c == 'l') { //new command letter
|
||||
if (c == 'M' || c == 'm' || c == 'L' || c == 'l') { //new command letter
|
||||
mode = c;
|
||||
} else if (c == '"') { //end of command chain
|
||||
return true;
|
||||
@ -76,13 +76,13 @@ function loadFromSvg(svgData) {
|
||||
numberEnd = svgData.indexOf(',', p);
|
||||
if (numberEnd == -1) { console.log("could not find comma in coordinate pair"); return false; }
|
||||
len = numberEnd - p;
|
||||
tx = parseInt(svgData.substr(p, len));
|
||||
tx = parseFloat(svgData.substr(p, len));
|
||||
p += len + 1;
|
||||
skipSpace();
|
||||
numberEnd = svgData.indexOf(' ', p);
|
||||
if (numberEnd == -1) { console.log("could not find space after coordinate pair"); return false; }
|
||||
len = numberEnd - p;
|
||||
ty = parseInt(svgData.substr(p, len));
|
||||
ty = parseFloat(svgData.substr(p, len));
|
||||
p += len;
|
||||
|
||||
if (mode == 'M' || mode == 'L') {
|
||||
|
Loading…
Reference in New Issue
Block a user