update:添加获取父类窗口异常处理,默认缩放比为1

This commit is contained in:
wangguixi 2022-11-01 10:14:28 +08:00 committed by yan wang
parent a8bf5cfa43
commit cd60590805
1 changed files with 5 additions and 0 deletions

View File

@ -318,6 +318,11 @@ AppWidget {
//,
//
//console.log("", appwidget.parent.width,appwidget.parent.height);
if(appwidget.parent.width == 0 || appwidget.parent.height == 0) {
appwidget.scalefactor = 1.0
console.log("父类窗口大小为 0 默认缩放比为1.0")
return
}
appwidget.scalefactor = appwidget.parent.width/448
//console.log("", appwidget.scalefactor);
var tw = appwidget.scalefactor *448