]> git.ipfire.org Git - thirdparty/Chart.js.git/commit
Fix context state restoration on destroy
authorSimon Brunel <simonbrunel@users.noreply.github.com>
Mon, 7 Nov 2016 23:16:58 +0000 (00:16 +0100)
committerEvert Timberg <evert.timberg+github@gmail.com>
Tue, 8 Nov 2016 00:16:45 +0000 (19:16 -0500)
commitefced4780ce2697d0d44bf1e32a4e2efebaa18e2
tree115ca3c40162e5a73e98f7612fd2f31dc865fcc3
parent040b0e160da689505e92e056fe4776095804adb1
Fix context state restoration on destroy

In many cases, the canvas render size is changed by the lib, causing the state stack to be discarded, meaning that we can't use save() and restore() to release the context with its initial state (i.e. before creating the chart). Since we don't need (want) to manually save / restore the context initial state, simply make sure to reset it to the default state to give a fresh context back to the user. That also means we don't need to revert the scale when the pixel device ratio is not 1.
src/core/core.controller.js
src/core/core.helpers.js
test/core.controller.tests.js