Merge pull request #621 from antvis/fix/meta

fix: getViewPortScale边界情况处理
This commit is contained in:
@thinkinggis 2021-01-14 16:18:55 +08:00 committed by GitHub
commit ac3c9c37f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -155,6 +155,9 @@ export function printCanvas(canvas: HTMLCanvasElement) {
export function getViewPortScale() {
const meta = document.querySelector('meta[name="viewport"]');
if (!meta) {
return 1;
}
const contentItems = (meta as any).content?.split(',');
const scale = contentItems.find((item: string) => {
const [key, value] = item.split('=');