Merge pull request #463 from NicolasPinzon/bug_fix

Bug fix
master
Dmitry Baranovskiy 2016-07-30 18:13:19 +10:00 committed by GitHub
commit 938350b999
5 changed files with 1405 additions and 1411 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "Snap.svg", "name": "Snap.svg",
"version": "0.3.0", "version": "0.4.1",
"homepage": "http://snapsvg.io", "homepage": "http://snapsvg.io",
"authors": [ "authors": [
"Dmitry Baranovskiy <dmitry@baranovskiy.com>" "Dmitry Baranovskiy <dmitry@baranovskiy.com>"

File diff suppressed because one or more lines are too long

21
dist/snap.svg.js vendored
View File

@ -14,7 +14,7 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
// //
// build: 2015-04-13 // build: 2016-06-09
// Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved. // Copyright (c) 2013 Adobe Systems Incorporated. All rights reserved.
// //
@ -795,13 +795,13 @@ var mina = (function (eve) {
return mina; return mina;
})(typeof eve == "undefined" ? function () {} : eve); })(typeof eve == "undefined" ? function () {} : eve);
// Copyright (c) 2013 - 2015 Adobe Systems Incorporated. All rights reserved. // Copyright (c) 2013 - 2015 Adobe Systems Incorporated. All rights reserved.
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
// You may obtain a copy of the License at // You may obtain a copy of the License at
// //
// http://www.apache.org/licenses/LICENSE-2.0 // http://www.apache.org/licenses/LICENSE-2.0
// //
// Unless required by applicable law or agreed to in writing, software // Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS, // distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@ -809,7 +809,7 @@ var mina = (function (eve) {
// limitations under the License. // limitations under the License.
var Snap = (function(root) { var Snap = (function(root) {
Snap.version = "0.3.0"; Snap.version = "0.4.1";
/*\ /*\
* Snap * Snap
[ method ] [ method ]
@ -1430,7 +1430,6 @@ Snap.getRGB = cacher(function (colour) {
} }
return {r: -1, g: -1, b: -1, hex: "none", error: 1, toString: rgbtoString}; return {r: -1, g: -1, b: -1, hex: "none", error: 1, toString: rgbtoString};
}, Snap); }, Snap);
// SIERRA It seems odd that the following 3 conversion methods are not expressed as .this2that(), like the others.
/*\ /*\
* Snap.hsb * Snap.hsb
[ method ] [ method ]
@ -1516,7 +1515,7 @@ prepareRGB = function (r, g, b) {
g /= 255; g /= 255;
b /= 255; b /= 255;
} }
return [r, g, b]; return [r, g, b];
}, },
packageRGB = function (r, g, b, o) { packageRGB = function (r, g, b, o) {
@ -1736,7 +1735,6 @@ Snap.rgb2hsl = function (r, g, b) {
}; };
// Transformations // Transformations
// SIERRA Snap.parsePathString(): By _array of arrays,_ I assume you mean a format like this for two separate segments? [ ["M10,10","L90,90"], ["M90,10","L10,90"] ] Otherwise how is each command structured?
/*\ /*\
* Snap.parsePathString * Snap.parsePathString
[ method ] [ method ]
@ -1755,7 +1753,7 @@ Snap.parsePathString = function (pathString) {
if (pth.arr) { if (pth.arr) {
return Snap.path.clone(pth.arr); return Snap.path.clone(pth.arr);
} }
var paramCounts = {a: 7, c: 6, o: 2, h: 1, l: 2, m: 2, r: 4, q: 4, s: 4, t: 2, v: 1, u: 3, z: 0}, var paramCounts = {a: 7, c: 6, o: 2, h: 1, l: 2, m: 2, r: 4, q: 4, s: 4, t: 2, v: 1, u: 3, z: 0},
data = []; data = [];
if (is(pathString, "array") && is(pathString[0], "array")) { // rough assumption if (is(pathString, "array") && is(pathString[0], "array")) { // rough assumption
@ -2252,7 +2250,6 @@ Snap.parse = function (svg) {
function Fragment(frag) { function Fragment(frag) {
this.node = frag; this.node = frag;
} }
// SIERRA Snap.fragment() could especially use a code example
/*\ /*\
* Snap.fragment * Snap.fragment
[ method ] [ method ]
@ -2291,7 +2288,7 @@ function Paper(w, h) {
desc, desc,
defs, defs,
proto = Paper.prototype; proto = Paper.prototype;
if (w && w.tagName == "svg") { if (w && w.tagName && w.tagName.toLowerCase() == "svg") {
if (w.snap in hub) { if (w.snap in hub) {
return hub[w.snap]; return hub[w.snap];
} }
@ -8170,4 +8167,4 @@ Snap.plugin(function (Snap, Element, Paper, glob, Fragment) {
}); });
return Snap; return Snap;
})); }));

File diff suppressed because it is too large Load Diff

View File

@ -1,11 +1,11 @@
// Copyright (c) 2013 - 2015 Adobe Systems Incorporated. All rights reserved. // Copyright (c) 2013 - 2015 Adobe Systems Incorporated. All rights reserved.
// //
// Licensed under the Apache License, Version 2.0 (the "License"); // Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License. // you may not use this file except in compliance with the License.
// You may obtain a copy of the License at // You may obtain a copy of the License at
// //
// http://www.apache.org/licenses/LICENSE-2.0 // http://www.apache.org/licenses/LICENSE-2.0
// //
// Unless required by applicable law or agreed to in writing, software // Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS, // distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@ -13,7 +13,7 @@
// limitations under the License. // limitations under the License.
var Snap = (function(root) { var Snap = (function(root) {
Snap.version = "0.3.0"; Snap.version = "0.4.1";
/*\ /*\
* Snap * Snap
[ method ] [ method ]
@ -634,7 +634,6 @@ Snap.getRGB = cacher(function (colour) {
} }
return {r: -1, g: -1, b: -1, hex: "none", error: 1, toString: rgbtoString}; return {r: -1, g: -1, b: -1, hex: "none", error: 1, toString: rgbtoString};
}, Snap); }, Snap);
// SIERRA It seems odd that the following 3 conversion methods are not expressed as .this2that(), like the others.
/*\ /*\
* Snap.hsb * Snap.hsb
[ method ] [ method ]
@ -720,7 +719,7 @@ prepareRGB = function (r, g, b) {
g /= 255; g /= 255;
b /= 255; b /= 255;
} }
return [r, g, b]; return [r, g, b];
}, },
packageRGB = function (r, g, b, o) { packageRGB = function (r, g, b, o) {
@ -940,7 +939,6 @@ Snap.rgb2hsl = function (r, g, b) {
}; };
// Transformations // Transformations
// SIERRA Snap.parsePathString(): By _array of arrays,_ I assume you mean a format like this for two separate segments? [ ["M10,10","L90,90"], ["M90,10","L10,90"] ] Otherwise how is each command structured?
/*\ /*\
* Snap.parsePathString * Snap.parsePathString
[ method ] [ method ]
@ -959,7 +957,7 @@ Snap.parsePathString = function (pathString) {
if (pth.arr) { if (pth.arr) {
return Snap.path.clone(pth.arr); return Snap.path.clone(pth.arr);
} }
var paramCounts = {a: 7, c: 6, o: 2, h: 1, l: 2, m: 2, r: 4, q: 4, s: 4, t: 2, v: 1, u: 3, z: 0}, var paramCounts = {a: 7, c: 6, o: 2, h: 1, l: 2, m: 2, r: 4, q: 4, s: 4, t: 2, v: 1, u: 3, z: 0},
data = []; data = [];
if (is(pathString, "array") && is(pathString[0], "array")) { // rough assumption if (is(pathString, "array") && is(pathString[0], "array")) { // rough assumption
@ -1456,7 +1454,6 @@ Snap.parse = function (svg) {
function Fragment(frag) { function Fragment(frag) {
this.node = frag; this.node = frag;
} }
// SIERRA Snap.fragment() could especially use a code example
/*\ /*\
* Snap.fragment * Snap.fragment
[ method ] [ method ]
@ -1495,7 +1492,7 @@ function Paper(w, h) {
desc, desc,
defs, defs,
proto = Paper.prototype; proto = Paper.prototype;
if (w && w.tagName == "svg") { if (w && w.tagName && w.tagName.toLowerCase() == "svg") {
if (w.snap in hub) { if (w.snap in hub) {
return hub[w.snap]; return hub[w.snap];
} }