diff --git a/components/packages/Platform/THPlatform.js b/components/packages/Platform/THPlatform.js index 76ff18c..fa9a7b4 100644 --- a/components/packages/Platform/THPlatform.js +++ b/components/packages/Platform/THPlatform.js @@ -42,9 +42,9 @@ class THPlatform extends JlPlatform { this.codeGraphic.draw(); this.lozengeGraphic.draw(); if (this.datas.direction == 'down') { - this.doorGraphic.changePosition(this.position); - this.codeGraphic.changePosition(this.position); - this.lozengeGraphic.changePosition(this.position); + this.doorGraphic.changePosition(); + this.codeGraphic.changePosition(); + this.lozengeGraphic.changePosition(); } //门的状态 if (this.datas.hasdoor) { diff --git a/components/packages/Platform/common/JlPlatform.d.ts b/components/packages/Platform/common/JlPlatform.d.ts index be5197a..6845a11 100644 --- a/components/packages/Platform/common/JlPlatform.d.ts +++ b/components/packages/Platform/common/JlPlatform.d.ts @@ -16,7 +16,7 @@ export declare class DoorGraphic extends Container { stateFillColor?: string; constructor(platformConsts: PlatformConstsConfig); draw(): void; - changePosition(platformPos: IPointData): void; + changePosition(): void; clear(): void; } export declare class CodeGraphic extends Container { @@ -28,7 +28,7 @@ export declare class CodeGraphic extends Container { circle: Graphics; constructor(platformConsts: PlatformConstsConfig); draw(): void; - changePosition(platformPos: IPointData): void; + changePosition(): void; clear(): void; } export declare class LozengeGraphic extends Container { @@ -36,7 +36,7 @@ export declare class LozengeGraphic extends Container { lozenge: Graphics; constructor(platformConsts: PlatformConstsConfig); draw(): void; - changePosition(platformPos: IPointData): void; + changePosition(): void; clear(): void; } export declare class DoorCodeLozenge extends Container { diff --git a/components/packages/Platform/common/JlPlatform.js b/components/packages/Platform/common/JlPlatform.js index f00863b..1e9374e 100644 --- a/components/packages/Platform/common/JlPlatform.js +++ b/components/packages/Platform/common/JlPlatform.js @@ -64,8 +64,8 @@ class DoorGraphic extends Container { .lineTo(doorConsts.doorOpenSpacing, 0); this.position.set(0, -platformConsts.height / 2 - doorConsts.doorPlatformSpacing); } - changePosition(platformPos) { - this.position.copyFrom(calculateMirrorPoint(new Point(0, 0), platformPos)); + changePosition() { + this.position.copyFrom(calculateMirrorPoint(new Point(0, 0), this.position)); } clear() { this.doorGraphic.clear(); @@ -141,7 +141,7 @@ class CodeGraphic extends Container { runTime.visible = false; this.position.set(0, 0); } - changePosition(platformPos) { + changePosition() { const platformConsts = this.platformConsts; const codeConsts = platformConsts.codeGraphic; const psChange = [ @@ -152,7 +152,7 @@ class CodeGraphic extends Container { ]; psChange.forEach((g) => { if (g) { - g.position.copyFrom(calculateMirrorPoint(new Point(0, 0), platformPos)); + g.position.copyFrom(calculateMirrorPoint(new Point(0, 0), g.position)); } }); this.circle.position.set(platformConsts.width / 2 + @@ -191,8 +191,8 @@ class LozengeGraphic extends Container { LozengeConsts.doorPlatformSpacing - platformConsts.height / 3); } - changePosition(platformPos) { - this.position.copyFrom(calculateMirrorPoint(new Point(0, 0), platformPos)); + changePosition() { + this.position.copyFrom(calculateMirrorPoint(new Point(0, 0), this.position)); } clear() { this.lozenge.clear(); @@ -221,9 +221,9 @@ class DoorCodeLozenge extends Container { this.codeGraphic.draw(); this.lozengeGraphic.draw(); if (direction == 'down') { - this.doorGraphic.changePosition(platformPos); - this.codeGraphic.changePosition(platformPos); - this.lozengeGraphic.changePosition(platformPos); + this.doorGraphic.changePosition(); + this.codeGraphic.changePosition(); + this.lozengeGraphic.changePosition(); } } } diff --git a/src/packages/Platform/THPlatform.ts b/src/packages/Platform/THPlatform.ts index a3930e9..3df9aa8 100644 --- a/src/packages/Platform/THPlatform.ts +++ b/src/packages/Platform/THPlatform.ts @@ -88,9 +88,9 @@ export class THPlatform extends JlPlatform { this.codeGraphic.draw(); this.lozengeGraphic.draw(); if (this.datas.direction == 'down') { - this.doorGraphic.changePosition(this.position); - this.codeGraphic.changePosition(this.position); - this.lozengeGraphic.changePosition(this.position); + this.doorGraphic.changePosition(); + this.codeGraphic.changePosition(); + this.lozengeGraphic.changePosition(); } //门的状态 if (this.datas.hasdoor) { diff --git a/src/packages/Platform/common/JlPlatform.ts b/src/packages/Platform/common/JlPlatform.ts index 5636e53..0ad2329 100644 --- a/src/packages/Platform/common/JlPlatform.ts +++ b/src/packages/Platform/common/JlPlatform.ts @@ -89,8 +89,10 @@ export class DoorGraphic extends Container { -platformConsts.height / 2 - doorConsts.doorPlatformSpacing, ); } - changePosition(platformPos: IPointData) { - this.position.copyFrom(calculateMirrorPoint(new Point(0, 0), platformPos)); + changePosition() { + this.position.copyFrom( + calculateMirrorPoint(new Point(0, 0), this.position), + ); } clear(): void { this.doorGraphic.clear(); @@ -181,7 +183,7 @@ export class CodeGraphic extends Container { runTime.visible = false; this.position.set(0, 0); } - changePosition(platformPos: IPointData) { + changePosition() { const platformConsts = this.platformConsts; const codeConsts = platformConsts.codeGraphic as CodeConstsConfig; const psChange = [ @@ -192,7 +194,7 @@ export class CodeGraphic extends Container { ]; psChange.forEach((g) => { if (g) { - g.position.copyFrom(calculateMirrorPoint(new Point(0, 0), platformPos)); + g.position.copyFrom(calculateMirrorPoint(new Point(0, 0), g.position)); } }); this.circle.position.set( @@ -242,8 +244,10 @@ export class LozengeGraphic extends Container { platformConsts.height / 3, ); } - changePosition(platformPos: IPointData) { - this.position.copyFrom(calculateMirrorPoint(new Point(0, 0), platformPos)); + changePosition() { + this.position.copyFrom( + calculateMirrorPoint(new Point(0, 0), this.position), + ); } clear(): void { this.lozenge.clear(); @@ -273,9 +277,9 @@ export class DoorCodeLozenge extends Container { this.codeGraphic.draw(); this.lozengeGraphic.draw(); if (direction == 'down') { - this.doorGraphic.changePosition(platformPos); - this.codeGraphic.changePosition(platformPos); - this.lozengeGraphic.changePosition(platformPos); + this.doorGraphic.changePosition(); + this.codeGraphic.changePosition(); + this.lozengeGraphic.changePosition(); } } }