]> git.ipfire.org Git - thirdparty/Chart.js.git/commit
Refactor helpers.canvas.drawPoint() (#5623)
authorAkihiko Kusanagi <nagi@nagi-p.com>
Sun, 29 Jul 2018 09:31:28 +0000 (16:31 +0700)
committerSimon Brunel <simonbrunel@users.noreply.github.com>
Sun, 29 Jul 2018 09:31:28 +0000 (11:31 +0200)
commit493eaa842444b4e5b1f6d192fadf2bb1aaa02eba
tree953a0c1c0bf88ee85a4afd3d773307f35d83ece3
parent0963c8f76c997643aa3aa1101c34ea31cb58eab2
Refactor helpers.canvas.drawPoint() (#5623)

Bring ctx.beginPath() before switch and replace ctx.fillRect()/ctx.strokeRect() with ctx.rect()/ctx.fill() to make it consistent with the other styles. It is also preferable that helpers.canvas.roundedRect() include ctx.closePath() at the end because CanvasRenderingContext2D.rect() closes the subpath.

Get rid of ctx.closePath() for cross, crossRot, star, line and dash because these have no closed path shape, and it should be avoided that ctx.closePath() makes a round-trip path.
src/helpers/helpers.canvas.js
test/specs/element.point.tests.js
test/specs/global.deprecations.tests.js
test/specs/helpers.canvas.tests.js