From 86e21da3011af13e2e0c8b60941352c849ec51e5 Mon Sep 17 00:00:00 2001 From: Jamie McElwain Date: Sat, 13 May 2017 12:11:52 +0100 Subject: [PATCH] Added width + height arguments to ctx.drawImage Previous functionality meant that images would be drawn at their source file size regardless of whether custom width or height properties were set. --- src/core/core.canvasHelpers.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/core.canvasHelpers.js b/src/core/core.canvasHelpers.js index 7d420524a8d..610095122b8 100644 --- a/src/core/core.canvasHelpers.js +++ b/src/core/core.canvasHelpers.js @@ -10,7 +10,7 @@ module.exports = function(Chart) { if (typeof pointStyle === 'object') { type = pointStyle.toString(); if (type === '[object HTMLImageElement]' || type === '[object HTMLCanvasElement]') { - ctx.drawImage(pointStyle, x - pointStyle.width / 2, y - pointStyle.height / 2); + ctx.drawImage(pointStyle, x - pointStyle.width / 2, y - pointStyle.height / 2, pointStyle.width, pointStyle.height); return; } }