Fix x-axis and y-axis not working in clip mode.

This commit is contained in:
Davide Tantillo 2024-10-01 13:01:53 +02:00
parent 6108d625c0
commit 6fa149756a

View File

@ -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);