workaround for Firefox's canvas resize bug