mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-04 14:24:53 +08:00
[ts][webcomponents] Fix overlay div size when body is smaller than document.
This commit is contained in:
parent
7ac6ae6987
commit
7366fcfa4e
@ -863,8 +863,7 @@ export class SpineWebComponentOverlay extends HTMLElement implements OverlayAttr
|
||||
this.div!.style.height = height + "px";
|
||||
} else {
|
||||
if (this.hasCssTweakOff()) {
|
||||
// this case lags if scrolls or position fixed
|
||||
// users should never use tweak off, unless the parent container has already a transform
|
||||
// this case lags if scrolls or position fixed. Users should never use tweak off
|
||||
this.div!.style.width = this.parentElement!.clientWidth + "px";
|
||||
this.div!.style.height = this.parentElement!.clientHeight + "px";
|
||||
this.canvas.style.transform = `translate(${-this.overflowLeftSize}px,${-this.overflowTopSize}px)`;
|
||||
@ -890,7 +889,7 @@ export class SpineWebComponentOverlay extends HTMLElement implements OverlayAttr
|
||||
// this means that during zoom it might occurs that the div would be resized
|
||||
// rounded 1px more making a scrollbar appear
|
||||
private getPageSize () {
|
||||
return document.body.getBoundingClientRect();
|
||||
return document.documentElement.getBoundingClientRect();
|
||||
}
|
||||
|
||||
private lastViewportWidth = 0;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user