Skip to content

Commit 2110fd4

Browse files
authored
Merge pull request #1182 from galacean/fix/spine-bounding-box
fix: spine bounding box issue
2 parents e906f6c + f7980d5 commit 2110fd4

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

plugin-packages/spine/src/spine-component.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,14 @@ export class SpineComponent extends RendererComponent implements Maskable {
304304
const p2 = new Vector3(centerX + width / 2, centerY + height / 2, 0);
305305
const p3 = new Vector3(centerX - width / 2, centerY + height / 2, 0);
306306

307+
// TODO: 优化 Spine 初始大小逻辑
308+
const startSizeScaleFactor = this.startSize * this.scaleFactor;
309+
310+
p0.multiply(startSizeScaleFactor);
311+
p1.multiply(startSizeScaleFactor);
312+
p2.multiply(startSizeScaleFactor);
313+
p3.multiply(startSizeScaleFactor);
314+
307315
wm.projectPoint(p0);
308316
wm.projectPoint(p1);
309317
wm.projectPoint(p2);

0 commit comments

Comments
 (0)