Merge pull request #381 from ThomasBrierley/issue_373
Fixed equal.js aggressive numeric type capture regressionmaster
commit
378b3a56b6
14
src/equal.js
14
src/equal.js
|
@ -121,13 +121,6 @@ Snap.plugin(function (Snap, Element, Paper, glob) {
|
||||||
eve.on("snap.util.equal", function (name, b) {
|
eve.on("snap.util.equal", function (name, b) {
|
||||||
var A, B, a = Str(this.attr(name) || ""),
|
var A, B, a = Str(this.attr(name) || ""),
|
||||||
el = this;
|
el = this;
|
||||||
if (isNumeric(a) && isNumeric(b)) {
|
|
||||||
return {
|
|
||||||
from: parseFloat(a),
|
|
||||||
to: parseFloat(b),
|
|
||||||
f: getNumber
|
|
||||||
};
|
|
||||||
}
|
|
||||||
if (names[name] == "colour") {
|
if (names[name] == "colour") {
|
||||||
A = Snap.color(a);
|
A = Snap.color(a);
|
||||||
B = Snap.color(b);
|
B = Snap.color(b);
|
||||||
|
@ -174,6 +167,13 @@ Snap.plugin(function (Snap, Element, Paper, glob) {
|
||||||
f: function (val) { return val; }
|
f: function (val) { return val; }
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
if (isNumeric(a) && isNumeric(b)) {
|
||||||
|
return {
|
||||||
|
from: parseFloat(a),
|
||||||
|
to: parseFloat(b),
|
||||||
|
f: getNumber
|
||||||
|
};
|
||||||
|
}
|
||||||
var aUnit = a.match(reUnit),
|
var aUnit = a.match(reUnit),
|
||||||
bUnit = Str(b).match(reUnit);
|
bUnit = Str(b).match(reUnit);
|
||||||
if (aUnit && arrayEqual(aUnit, bUnit)) {
|
if (aUnit && arrayEqual(aUnit, bUnit)) {
|
||||||
|
|
Loading…
Reference in New Issue