You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You're partially right, but clientWidth is also incorrect, it still includes the padding.
Either way, the autosizing doesn't take canvas padding/border styles into account, it measures the parent element and sizes the canvas to fit inside that.
So while I can change this in the code, the real fix would probably require computed styles or one of the bounding box methods.
Here's the test for size.spec.js that would check this behavior, it fails with both offsetWidth or clientWidth:
If I do
will report an offsetWidth of 400px even though the canvas content is really only 300px across.
Similarly
offsetWidth will be 100px too large.
Are you sure you don't want clientWidth and clientHeight instead of offsetWidth and offsetHeight?
The text was updated successfully, but these errors were encountered: