From 6fa149756ab3c891c272df3a8ada6d2b99090758 Mon Sep 17 00:00:00 2001 From: Davide Tantillo Date: Tue, 1 Oct 2024 13:01:53 +0200 Subject: [PATCH] Fix x-axis and y-axis not working in clip mode. --- spine-ts/spine-webgl/src/SpineWebComponentWidget.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/spine-ts/spine-webgl/src/SpineWebComponentWidget.ts b/spine-ts/spine-webgl/src/SpineWebComponentWidget.ts index 048a01eed..b18385b33 100644 --- a/spine-ts/spine-webgl/src/SpineWebComponentWidget.ts +++ b/spine-ts/spine-webgl/src/SpineWebComponentWidget.ts @@ -1082,6 +1082,8 @@ class SpineWebComponentOverlay extends HTMLElement implements Disposable { if (clip) { // in clip mode, the world origin is the div center (divBounds center) clipToBoundStart(divBounds); + divOriginX = divBounds.width * (xAxis * window.devicePixelRatio); + divOriginY = divBounds.height * (yAxis * window.devicePixelRatio); } else { // get the desired point into the the div (center by default) in world coordinate const divX = divBounds.x + divBounds.width * (xAxis + .5);