Skip to content

Conversation

@zackbrown
Copy link

Problem: elements styled with percentage widths or heights (e.g. width: 100%) throw an error on the line cs.clip = "rect(0 " + width + " " + height + " 0)";

Proposed solution: apply to the canvas whatever width/height are provided, then if width/height are percentage strings, read the computed (pixel) width/height using offsetWidth and offsetHeight, passing those values to the cs.clip property.

Not extensively tested, but fixed the bugs I was coming up against. Hopefully someone with more knowledge of this project can review and see if this is a suitable fix.

@zackbrown
Copy link
Author

(I should specify, this was for IE8--I came up against issue this working with r2d3)

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant