fixed an issue where setPixelRatio changed canvas to wrong size