From 75010ff62c614ec06158be9b3b387a28f48507dd Mon Sep 17 00:00:00 2001 From: VicKun4937 Date: Mon, 18 Nov 2024 20:15:05 +0800 Subject: [PATCH 1/2] fix(drawing): set drawing bounding in left/top to A1 cell --- .../engine-render/src/components/sheets/sheet-component.ts | 1 + packages/engine-render/src/components/sheets/spreadsheet.ts | 2 ++ packages/engine-render/src/scene.transformer.ts | 5 +++++ packages/engine-render/src/scene.ts | 4 ++++ 4 files changed, 12 insertions(+) diff --git a/packages/engine-render/src/components/sheets/sheet-component.ts b/packages/engine-render/src/components/sheets/sheet-component.ts index 43845b08fe3..2cb76d98286 100644 --- a/packages/engine-render/src/components/sheets/sheet-component.ts +++ b/packages/engine-render/src/components/sheets/sheet-component.ts @@ -37,6 +37,7 @@ export abstract class SheetComponent extends RenderComponent layer, getObjects --> viewport.render(object) --> spreadsheet // SHEET_COMPONENT_MAIN_LAYER_INDEX = 0; diff --git a/packages/engine-render/src/scene.transformer.ts b/packages/engine-render/src/scene.transformer.ts index 86481ec4894..288690f17cb 100644 --- a/packages/engine-render/src/scene.transformer.ts +++ b/packages/engine-render/src/scene.transformer.ts @@ -207,6 +207,11 @@ export class Transformer extends Disposable implements ITransformerConfig { super(); this._initialProps(config); } + + updateZeroPoint(left: number, top: number) { + this.zeroLeft = left; + this.zeroTop = top; + } changeNotification() { this._changing$.next({ diff --git a/packages/engine-render/src/scene.ts b/packages/engine-render/src/scene.ts index f241dfd2575..0d262e6ef41 100644 --- a/packages/engine-render/src/scene.ts +++ b/packages/engine-render/src/scene.ts @@ -653,6 +653,10 @@ export class Scene extends ThinScene { return this._transformer; } + updateTransformerZero(left: number, top: number) { + this._transformer?.updateZeroPoint(left, top); + } + /** * prev getActiveViewportByRelativeCoord * @param coord From f8ab6162040b6de73eb461875f54a94bb8b67c18 Mon Sep 17 00:00:00 2001 From: VicKun4937 Date: Mon, 18 Nov 2024 20:21:50 +0800 Subject: [PATCH 2/2] fix(drawing): fix format --- packages/engine-render/src/scene.transformer.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/engine-render/src/scene.transformer.ts b/packages/engine-render/src/scene.transformer.ts index 288690f17cb..22e7670e363 100644 --- a/packages/engine-render/src/scene.transformer.ts +++ b/packages/engine-render/src/scene.transformer.ts @@ -207,7 +207,7 @@ export class Transformer extends Disposable implements ITransformerConfig { super(); this._initialProps(config); } - + updateZeroPoint(left: number, top: number) { this.zeroLeft = left; this.zeroTop = top;