Home forums Report Bugs Zoom Scaling breaks canvas drawing

This topic contains 1 reply, has 2 voices, and was last updated by  Sunil Urs 1 year, 9 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #8158

    Tsueah
    Participant

    How to reproduce?
    -Open http://canvasjs.com/docs/charts/chart-options/animation-duration/

    -change browser’s zoom/scaling to something below 100% and reload the page.

    This breaks the graph rendering at least for IE and FF (chrome seems to be unaffected in my tests).
    FF console shows the following error:

    IndexSizeError: Index or size is negative or greater than the allowed amount canvasjs.min.js:83

    This targets the following function:

    _this.ctx.drawImage(initialState, 0, 0, _this.width * devicePixelBackingStoreRatio, _this.height * devicePixelBackingStoreRatio, 0, 0, _this.width, _this.height);

    I’ve fixed it locally by flooring the computed values for ctx.draw before passing them over.
    Would be good to have that fixed upstream, as it seems to affect other users aswell (got a report from someone that my graphs are broken and was only able to reproduce the problem on a single browser, which had page scaling != 100%).

    • This topic was modified 1 year, 10 months ago by  Tsueah.
    #8182

    Sunil Urs
    Keymaster

    Tsueah,

    Thanks for reporting the issue. We’ll fix this issue in the next version.


    Sunil Urs

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.