-
Notifications
You must be signed in to change notification settings - Fork 0
0C How to set the size of the Canvas
Luis Murillo Baltodano edited this page Jul 29, 2020
·
1 revision
preset(({size}) => {
size()
})
If you don't pass arguments to the function, the canvas's size will attach the window.innerWidth and window.innerHeight values to the canvas width and height respectively
size({
width: 400,
height: 300
})
size({
width: () => element.clientWidth,
height: () => element.clientHeight
})
If your element changes its width the window resize event it will change the size of the canvas as well