forked from openkylin/ukui-system-appwidget
update:添加获取父类窗口异常处理,默认缩放比为1
This commit is contained in:
parent
a8bf5cfa43
commit
cd60590805
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue