]> git.ipfire.org Git - thirdparty/Chart.js.git/commit
Set maxWidth during title draw to avoid overflow
authordylan-kerr <dylan-kerr@users.noreply.github.com>
Fri, 23 Sep 2016 21:05:54 +0000 (22:05 +0100)
committerDylan Kerr <blackknight@ucc.asn.au>
Fri, 23 Sep 2016 21:15:23 +0000 (22:15 +0100)
commitfb302d5f0074b5d367386319e696d5718b78a88d
treef349ec26e6cb7bb93d12238aa09fca85343c1781
parent84da2e0a1056ab7959028685dc12616ac8b8fc56
Set maxWidth during title draw to avoid overflow

CanvasRenderingContext2D.fillText() accepts a fourth parameter called maxWidth that sets the maximum width of the drawn text, enforced by scaling the entire line.

This commit uses the title element's layout dimensions to set maxWidth and avoid overflow outside of the canvas.
src/core/core.title.js