mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-04 14:24:53 +08:00
Overlay needs to consider border if it's scrollable.
This commit is contained in:
parent
197571e671
commit
c8b0272ca8
@ -1724,7 +1724,14 @@ class SpineWebComponentOverlay extends HTMLElement implements OverlayAttributes,
|
||||
renderer.begin();
|
||||
|
||||
let ref: DOMRect;
|
||||
if (this.scrollable) ref = this.parentElement!.getBoundingClientRect();
|
||||
let offsetLeftForOevrlay = 0;
|
||||
let offsetTopForOverlay = 0;
|
||||
if (this.scrollable) {
|
||||
ref = this.parentElement!.getBoundingClientRect();
|
||||
const computedStyle = getComputedStyle(this.parentElement!);
|
||||
offsetLeftForOevrlay = ref.left + parseFloat(computedStyle.borderLeftWidth);
|
||||
offsetTopForOverlay = ref.top + parseFloat(computedStyle.borderTopWidth);
|
||||
}
|
||||
|
||||
const tempVector = new Vector3();
|
||||
this.skeletonList.forEach((widget) => {
|
||||
@ -1738,8 +1745,8 @@ class SpineWebComponentOverlay extends HTMLElement implements OverlayAttributes,
|
||||
divBounds.y = divBounds.top + this.overflowTopSize;
|
||||
|
||||
if (this.scrollable) {
|
||||
divBounds.x -= ref.left;
|
||||
divBounds.y -= ref.top;
|
||||
divBounds.x -= offsetLeftForOevrlay;
|
||||
divBounds.y -= offsetTopForOverlay;
|
||||
}
|
||||
|
||||
const { padLeft, padRight, padTop, padBottom } = widget
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user