From 53e71651c044f4a95c3dc89e327a771238c70a42 Mon Sep 17 00:00:00 2001 From: gary-Shen Date: Tue, 5 Nov 2024 15:48:28 +0800 Subject: [PATCH 1/3] fix(image): fix #527 --- packages/image/src/core/Monitor.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/image/src/core/Monitor.ts b/packages/image/src/core/Monitor.ts index 64ecaff1..a10403fe 100644 --- a/packages/image/src/core/Monitor.ts +++ b/packages/image/src/core/Monitor.ts @@ -37,7 +37,7 @@ export class Monitor { private _options: MonitorOption; // TODO: 清空标注时这里也要清空 - private _orderIndexedAnnotationIds: string[] = []; + private _orderIndexedAnnotationIds: (string | undefined)[] = []; /** 键盘按键记录 */ private _keyStatus: Record = { @@ -119,7 +119,7 @@ export class Monitor { return; } - _orderIndexedAnnotationIds.splice(order, 1); + _orderIndexedAnnotationIds[order] = undefined; }; private _handleClear = () => { @@ -307,7 +307,9 @@ export class Monitor { } public getNextOrder() { - return this.getMaxOrder() + 1; + const maxOrder = this.getMaxOrder(); + console.log('maxOrder', maxOrder); + return maxOrder + 1; } public destroy() { From fe5c6a91f6f4d32a9eb47f8bba1d2099d6df3f2a Mon Sep 17 00:00:00 2001 From: gary-Shen Date: Tue, 5 Nov 2024 15:49:53 +0800 Subject: [PATCH 2/3] update(image): fix #527 --- packages/image/src/core/Monitor.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/image/src/core/Monitor.ts b/packages/image/src/core/Monitor.ts index a10403fe..df22fc0b 100644 --- a/packages/image/src/core/Monitor.ts +++ b/packages/image/src/core/Monitor.ts @@ -307,9 +307,7 @@ export class Monitor { } public getNextOrder() { - const maxOrder = this.getMaxOrder(); - console.log('maxOrder', maxOrder); - return maxOrder + 1; + return this.getMaxOrder() + 1; } public destroy() { From 2df24387042d342a8ceea3ec6427d73f1332d9c2 Mon Sep 17 00:00:00 2001 From: gary-Shen Date: Wed, 6 Nov 2024 17:27:24 +0800 Subject: [PATCH 3/3] fix(frontend): add image meta info to support rotated image --- apps/frontend/src/utils/convertImageSample.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/apps/frontend/src/utils/convertImageSample.ts b/apps/frontend/src/utils/convertImageSample.ts index 0d113c88..0b71d48a 100644 --- a/apps/frontend/src/utils/convertImageSample.ts +++ b/apps/frontend/src/utils/convertImageSample.ts @@ -81,5 +81,6 @@ export function convertImageSample( id, url, data: convertImageAnnotations(resultParsed, config), + meta: _.pick(resultParsed, ['width', 'height', 'rotate']), }; }