changed handling of canvas width/height