Commit 245ec63f authored by rockyl's avatar rockyl

适配css样式

parent 2c3d355a
......@@ -559,7 +559,7 @@ export class Stage extends Container {
* @return {{w: number, h: number}}
*/
public getRootDivWH(div: HTMLDivElement) {
let sw = div.style.width;
/*let sw = div.style.width;
let sh = div.style.height;
let iw = document.body.clientWidth;
// let ih = document.body.clientHeight-40;
......@@ -580,7 +580,11 @@ export class Stage extends Container {
vH *= ih / 100;
}
}
return {w: vW, h: vH};
return {w: vW, h: vH};*/
let divBound = div.getBoundingClientRect();
let w = divBound.width;
let h = divBound.height;
return {w, h};
}
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment