Skip to content

Commit 7221dc4

Browse files
Merge pull request #688 from HardyNLee/fix-figure-initial-position
fix: figure initial position
2 parents 03c44e9 + 3ade111 commit 7221dc4

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

packages/webgal/src/Core/controller/stage/pixi/PixiController.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@ export default class PixiStage {
563563
const targetHeight = originalHeight * targetScale;
564564
thisFigureContainer.setBaseY(this.stageHeight / 2);
565565
if (targetHeight < this.stageHeight) {
566-
thisFigureContainer.setBaseY(this.stageHeight / 2 + this.stageHeight - targetHeight / 2);
566+
thisFigureContainer.setBaseY(this.stageHeight / 2 + (this.stageHeight - targetHeight) / 2);
567567
}
568568
if (presetPosition === 'center') {
569569
thisFigureContainer.setBaseX(this.stageWidth / 2);
@@ -673,7 +673,7 @@ export default class PixiStage {
673673

674674
let baseY = stageHeight / 2;
675675
if (targetHeight < stageHeight) {
676-
baseY = stageHeight / 2 + stageHeight - targetHeight / 2;
676+
baseY = stageHeight / 2 + (stageHeight - targetHeight) / 2;
677677
}
678678
thisFigureContainer.setBaseY(baseY);
679679
if (pos === 'center') {

packages/webgal/src/Core/controller/stage/pixi/spine.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ export async function addSpineFigureImpl(
126126
const targetHeight = originalHeight * targetScale;
127127
thisFigureContainer.setBaseY(this.stageHeight / 2);
128128
if (targetHeight < this.stageHeight) {
129-
thisFigureContainer.setBaseY(this.stageHeight / 2 + this.stageHeight - targetHeight / 2);
129+
thisFigureContainer.setBaseY(this.stageHeight / 2 + (this.stageHeight - targetHeight) / 2);
130130
}
131131
if (presetPosition === 'center') {
132132
thisFigureContainer.setBaseX(this.stageWidth / 2);

0 commit comments

Comments
 (0)