Only get canvas width & height once