Fix for Firefox rendering, exposed createUUID() and added docs for delay() method
This commit is contained in:
parent
1dacaa3842
commit
0c4db23235
File diff suppressed because one or more lines are too long
|
|
@ -283,7 +283,7 @@
|
|||
return rectPath(bbox.x, bbox.y, bbox.width, bbox.height);
|
||||
}
|
||||
},
|
||||
mapPath = function (path, matrix) {
|
||||
mapPath = R.mapPath = function (path, matrix) {
|
||||
if (!matrix) {
|
||||
return path;
|
||||
}
|
||||
|
|
@ -467,7 +467,13 @@
|
|||
return value;
|
||||
};
|
||||
|
||||
var createUUID = R._createUUID = (function (uuidRegEx, uuidReplacer) {
|
||||
/*\
|
||||
* Raphael.createUUID
|
||||
[ method ]
|
||||
**
|
||||
* Returns RFC4122, version 4 ID
|
||||
\*/
|
||||
var createUUID = R.createUUID = (function (uuidRegEx, uuidReplacer) {
|
||||
return function () {
|
||||
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(uuidRegEx, uuidReplacer).toUpperCase();
|
||||
};
|
||||
|
|
@ -3655,6 +3661,9 @@
|
|||
- delay (number) number of ms to pass between animation start and actual animation
|
||||
**
|
||||
= (object) new altered Animation object
|
||||
| var anim = Raphael.animation({cx: 10, cy: 20}, 2e3);
|
||||
| circle1.animate(anim); // run the given animation immediately
|
||||
| circle2.animate(anim.delay(500)); // run the given animation after 500 ms
|
||||
\*/
|
||||
Animation.prototype.delay = function (delay) {
|
||||
var a = new Animation(this.anim, this.ms);
|
||||
|
|
|
|||
11
raphael.js
11
raphael.js
|
|
@ -416,7 +416,7 @@
|
|||
return rectPath(bbox.x, bbox.y, bbox.width, bbox.height);
|
||||
}
|
||||
},
|
||||
mapPath = function (path, matrix) {
|
||||
mapPath = R.mapPath = function (path, matrix) {
|
||||
if (!matrix) {
|
||||
return path;
|
||||
}
|
||||
|
|
@ -513,7 +513,8 @@
|
|||
return value;
|
||||
};
|
||||
|
||||
var createUUID = R._createUUID = (function (uuidRegEx, uuidReplacer) {
|
||||
|
||||
var createUUID = R.createUUID = (function (uuidRegEx, uuidReplacer) {
|
||||
return function () {
|
||||
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(uuidRegEx, uuidReplacer).toUpperCase();
|
||||
};
|
||||
|
|
@ -3698,7 +3699,7 @@ window.Raphael.svg && function (R) {
|
|||
o.clip && o.clip.parentNode.parentNode.removeChild(o.clip.parentNode);
|
||||
var el = $("clipPath"),
|
||||
rc = $("rect");
|
||||
el.id = R._createUUID();
|
||||
el.id = R.createUUID();
|
||||
$(rc, {
|
||||
x: rect[0],
|
||||
y: rect[1],
|
||||
|
|
@ -3808,7 +3809,7 @@ window.Raphael.svg && function (R) {
|
|||
if (isURL) {
|
||||
el = $("pattern");
|
||||
var ig = $("image");
|
||||
el.id = R._createUUID();
|
||||
el.id = R.createUUID();
|
||||
$(el, {x: 0, y: 0, patternUnits: "userSpaceOnUse", height: 1, width: 1});
|
||||
$(ig, {x: 0, y: 0, "xlink:href": isURL[1]});
|
||||
el.appendChild(ig);
|
||||
|
|
@ -4206,7 +4207,7 @@ window.Raphael.svg && function (R) {
|
|||
var fltr = $("filter"),
|
||||
blur = $("feGaussianBlur");
|
||||
t.attrs.blur = size;
|
||||
fltr.id = R._createUUID();
|
||||
fltr.id = R.createUUID();
|
||||
$(blur, {stdDeviation: +size || 1.5});
|
||||
fltr.appendChild(blur);
|
||||
t.paper.defs.appendChild(fltr);
|
||||
|
|
|
|||
|
|
@ -362,7 +362,7 @@ window.Raphael.svg && function (R) {
|
|||
o.clip && o.clip.parentNode.parentNode.removeChild(o.clip.parentNode);
|
||||
var el = $("clipPath"),
|
||||
rc = $("rect");
|
||||
el.id = R._createUUID();
|
||||
el.id = R.createUUID();
|
||||
$(rc, {
|
||||
x: rect[0],
|
||||
y: rect[1],
|
||||
|
|
@ -472,7 +472,7 @@ window.Raphael.svg && function (R) {
|
|||
if (isURL) {
|
||||
el = $("pattern");
|
||||
var ig = $("image");
|
||||
el.id = R._createUUID();
|
||||
el.id = R.createUUID();
|
||||
$(el, {x: 0, y: 0, patternUnits: "userSpaceOnUse", height: 1, width: 1});
|
||||
$(ig, {x: 0, y: 0, "xlink:href": isURL[1]});
|
||||
el.appendChild(ig);
|
||||
|
|
@ -1110,7 +1110,7 @@ window.Raphael.svg && function (R) {
|
|||
var fltr = $("filter"),
|
||||
blur = $("feGaussianBlur");
|
||||
t.attrs.blur = size;
|
||||
fltr.id = R._createUUID();
|
||||
fltr.id = R.createUUID();
|
||||
$(blur, {stdDeviation: +size || 1.5});
|
||||
fltr.appendChild(blur);
|
||||
t.paper.defs.appendChild(fltr);
|
||||
|
|
@ -1280,7 +1280,7 @@ window.Raphael.svg && function (R) {
|
|||
R.prototype.renderfix = function () {
|
||||
var cnvs = this.canvas,
|
||||
s = cnvs.style,
|
||||
pos = cnvs.getScreenCTM(),
|
||||
pos = cnvs.getScreenCTM() || cnvs.createSVGMatrix(),
|
||||
left = -pos.e % 1,
|
||||
top = -pos.f % 1;
|
||||
if (left || top) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue