From 5bf291ee4dd9d858ee3056a594362732442cc9ac Mon Sep 17 00:00:00 2001 From: Mahiru Date: Mon, 6 Nov 2023 21:34:34 +0800 Subject: [PATCH 1/2] fix: pixi container pivot error --- .../src/Core/controller/stage/pixi/PixiController.ts | 10 +++++----- .../controller/stage/pixi/WebGALPixiContainer.ts | 12 ++++-------- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/packages/webgal/src/Core/controller/stage/pixi/PixiController.ts b/packages/webgal/src/Core/controller/stage/pixi/PixiController.ts index a98c68335..5db50cf10 100644 --- a/packages/webgal/src/Core/controller/stage/pixi/PixiController.ts +++ b/packages/webgal/src/Core/controller/stage/pixi/PixiController.ts @@ -33,7 +33,7 @@ export interface IStageObject { uuid: string; // 一般与作用目标有关 key: string; - pixiContainer: PIXI.Container; + pixiContainer: WebGALPixiContainer; // 相关的源 url sourceUrl: string; } @@ -226,10 +226,10 @@ export default class PixiStage { x: target.pixiContainer.scale.x, y: target.pixiContainer.scale.y, }, - pivot: { - x: target.pixiContainer.pivot.x, - y: target.pixiContainer.pivot.y, - }, + // pivot: { + // x: target.pixiContainer.pivot.x, + // y: target.pixiContainer.pivot.y, + // }, position: { x: target.pixiContainer.x, y: target.pixiContainer.y, diff --git a/packages/webgal/src/Core/controller/stage/pixi/WebGALPixiContainer.ts b/packages/webgal/src/Core/controller/stage/pixi/WebGALPixiContainer.ts index c7a4302e1..889804fd6 100644 --- a/packages/webgal/src/Core/controller/stage/pixi/WebGALPixiContainer.ts +++ b/packages/webgal/src/Core/controller/stage/pixi/WebGALPixiContainer.ts @@ -27,10 +27,8 @@ export class WebGALPixiContainer extends PIXI.Container { } public get x() { - if (!super.position) { - return 0; - } - return super.position.x - this.baseX; + const rX = super.position?.x ?? 0; + return rX - this.baseX; } public set x(value) { @@ -41,10 +39,8 @@ export class WebGALPixiContainer extends PIXI.Container { } public get y() { - if (!super.position) { - return 0; - } - return super.position.y - this.baseY; + const rY = super.position?.y ?? 0; + return rY - this.baseY; } public set y(value) { From e1fc20578719a6ebc3d725270492897c406418fc Mon Sep 17 00:00:00 2001 From: Mahiru Date: Mon, 6 Nov 2023 21:36:10 +0800 Subject: [PATCH 2/2] Update info.ts --- packages/webgal/src/config/info.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/webgal/src/config/info.ts b/packages/webgal/src/config/info.ts index 03494ee68..1ccaba9eb 100644 --- a/packages/webgal/src/config/info.ts +++ b/packages/webgal/src/config/info.ts @@ -1,5 +1,5 @@ export const __INFO = { - version: 'WebGAL 4.4.6', + version: 'WebGAL 4.4.6.1', contributors: [ { username: 'Mahiru', link: 'https://github.com/MakinoharaShoko' }, { username: 'Hoshinokinya', link: 'https://github.com/hshqwq' },