toCanvas fix (width/height can be too small)