Skip to content

Commit

Permalink
Fix x-axis and y-axis not working in clip mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
davidetan committed Oct 1, 2024
1 parent 6108d62 commit 6fa1497
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions spine-ts/spine-webgl/src/SpineWebComponentWidget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 6fa1497

Please sign in to comment.