Browse files

Fix a bug with negative sizes in Internet Explorer versions 5.5, 6, 7…

…, 8, and 9.
  • Loading branch information...
1 parent 52bff46 commit b77581273f5db322eda5efe3a3ab7b4965f04aab Curtis Schlak committed May 30, 2012
Showing with 12 additions and 4 deletions.
  1. +6 −2 raphael.js
  2. +6 −2 raphael.vml.js
View
8 raphael.js
@@ -5690,8 +5690,12 @@ window.Raphael.vml && function (R) {
this.height = height;
width == +width && (width += "px");
height == +height && (height += "px");
- cs.width = width;
- cs.height = height;
+ if(width[0] !== '-') {
+ cs.width = width;
+ }
+ if(height[0] !== '-') {
+ cs.height = height;
+ }
cs.clip = "rect(0 " + width + " " + height + " 0)";
if (this._viewBox) {
R._engine.setViewBox.apply(this, this._viewBox);
View
8 raphael.vml.js
@@ -848,8 +848,12 @@ window.Raphael.vml && function (R) {
this.height = height;
width == +width && (width += "px");
height == +height && (height += "px");
- cs.width = width;
- cs.height = height;
+ if(width[0] !== '-') {
+ cs.width = width;
+ }
+ if(height[0] !== '-') {
+ cs.height = height;
+ }
cs.clip = "rect(0 " + width + " " + height + " 0)";
if (this._viewBox) {
R._engine.setViewBox.apply(this, this._viewBox);

0 comments on commit b775812

Please sign in to comment.