Skip to content
This repository was archived by the owner on Apr 8, 2018. It is now read-only.
This repository was archived by the owner on Apr 8, 2018. It is now read-only.

Invalid argument (IE8) #123

Closed
Closed
@ldub

Description

@ldub

Line 5136 was throwing an invalid argument exception for me:

 R._engine.setSize = function(width, height) {
    var cs = this.canvas.style;
    this.width = width;
    this.height = height;
    width == +width && (width += "px");
    height == +height && (height += "px");
    cs.width = width; //THIS LINE CAUSES ERROR
    cs.height = height;
    cs.clip = "rect(0 " + width + " " + height + " 0)";
    if (this._viewBox) {
      R._engine.setViewBox.apply(this, this._viewBox);
    }
    return this;
  };

I changed this to

 R._engine.setSize = function(width, height) {
    var cs = this.canvas.style;
    this.width = width;
    this.height = height;
    width == +width && (width += "px");
    height == +height && (height += "px");
    if (width == "0px") {
        width = "1px";
    }
    if (height == "0px") {
        height = "1px";
    }
    cs.width = width; 
    cs.height = height;
    cs.clip = "rect(0 " + width + " " + height + " 0)";
    if (this._viewBox) {
      R._engine.setViewBox.apply(this, this._viewBox);
    }
    return this;
  };

and the error goes away. But really I have absolutely no idea what I'm doing, so I figure this might be useful info for you to know. It seems that 0px is not a valid property for width or height...

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions