Merge pull request #390 from chuchuva/2.0
authorDmitry Baranovskiy <dmitry.baranovskiy@gmail.com>
Mon, 5 Sep 2011 05:08:04 +0000 (22:08 -0700)
committerDmitry Baranovskiy <dmitry.baranovskiy@gmail.com>
Mon, 5 Sep 2011 05:08:04 +0000 (22:08 -0700)
clip-rect attribute bugfix

1  2 
raphael.js

diff --combined raphael.js
                  return rectPath(bbox.x, bbox.y, bbox.width, bbox.height);
              }
          },
 -        mapPath = function (path, matrix) {
 +        mapPath = R.mapPath = function (path, matrix) {
              if (!matrix) {
                  return path;
              }
          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();
          };
@@@ -3699,7 -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],
                          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);
              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);
@@@ -4607,8 -4606,7 +4607,7 @@@ window.Raphael.vml && function (R) 
                  rect[2] = +rect[2] + (+rect[0]);
                  rect[3] = +rect[3] + (+rect[1]);
                  var div = node.clipRect || R._g.doc.createElement("div"),
-                     dstyle = div.style,
-                     group = node.parentNode;
+                     dstyle = div.style;
                  dstyle.clip = R.format("rect({1}px {2}px {3}px {0}px)", rect);
                  if (!node.clipRect) {
                      dstyle.position = "absolute";
                      dstyle.left = 0;
                      dstyle.width = o.paper.width + "px";
                      dstyle.height = o.paper.height + "px";
-                     group.parentNode.insertBefore(div, group);
-                     div.appendChild(group);
+                     node.parentNode.insertBefore(div, node);
+                     div.appendChild(node);
                      node.clipRect = div;
                  }
              }