From 197571e671f5ed42c4f567779c6885771f80bcef Mon Sep 17 00:00:00 2001 From: Davide Tantillo Date: Wed, 26 Mar 2025 11:16:28 +0100 Subject: [PATCH] Overlay parent bounding box determined only if necessary. --- spine-ts/spine-webgl/src/SpineWebComponentWidget.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spine-ts/spine-webgl/src/SpineWebComponentWidget.ts b/spine-ts/spine-webgl/src/SpineWebComponentWidget.ts index 6c5901297..cafd5c336 100644 --- a/spine-ts/spine-webgl/src/SpineWebComponentWidget.ts +++ b/spine-ts/spine-webgl/src/SpineWebComponentWidget.ts @@ -1723,7 +1723,9 @@ class SpineWebComponentOverlay extends HTMLElement implements OverlayAttributes, let renderer = this.renderer; renderer.begin(); - const ref = this.parentElement!.getBoundingClientRect(); + let ref: DOMRect; + if (this.scrollable) ref = this.parentElement!.getBoundingClientRect(); + const tempVector = new Vector3(); this.skeletonList.forEach((widget) => { const { skeleton, pma, bounds, mode, debug, offsetX, offsetY, xAxis, yAxis, dragX, dragY, fit, loadingSpinner, onScreen, loading, clip, isDraggable } = widget;