From af8efbf6d329f4086cb9ca90de9404c6634bae3d Mon Sep 17 00:00:00 2001 From: Liuuuuuu Date: Fri, 25 Aug 2023 01:49:02 +0000 Subject: [PATCH] =?UTF-8?q?update=20Media/ImageEdit/entry/src/main/ets/pag?= =?UTF-8?q?es/HomePage.ets.=20=E6=9B=B4=E6=96=B0hdc=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Liuuuuuu --- .../entry/src/main/ets/pages/HomePage.ets | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Media/ImageEdit/entry/src/main/ets/pages/HomePage.ets b/Media/ImageEdit/entry/src/main/ets/pages/HomePage.ets index 9988ec0b..87dd6658 100644 --- a/Media/ImageEdit/entry/src/main/ets/pages/HomePage.ets +++ b/Media/ImageEdit/entry/src/main/ets/pages/HomePage.ets @@ -57,12 +57,7 @@ struct HomePage { aboutToAppear() { this.pixelInit(); - window.getLastWindow(getContext(this), (err, window) => { - if (err) { - Logger.error(`window loading has error: ${JSON.stringify(err)}`); - } - this.statusBar = window.getWindowProperties().windowRect?.top; - }); + this.statusBar = globalThis.statusBar; } build() { @@ -246,6 +241,7 @@ struct HomePage { break; case CropType.RECTANGLE: this.cropRatio = CropRatioType.RATIO_TYPE_16_9; + break; default: this.cropRatio = CropRatioType.RATIO_TYPE_FREE; break; @@ -257,7 +253,7 @@ struct HomePage { try { this.pixelMap.rotate(CommonConstants.CLOCK_WISE) .then(() => { - this.flushPixelMap(); + this.flushPixelMapNew(); }) } catch (error) { Logger.error(TAG, `there is a error in rotate process with ${error?.code}`); @@ -267,7 +263,7 @@ struct HomePage { try { this.pixelMap.rotate(CommonConstants.ANTI_CLOCK) .then(() => { - this.flushPixelMap(); + this.flushPixelMapNew(); }) } catch (error) { Logger.error(TAG, `there is a error in rotate process with ${error?.code}`); @@ -282,6 +278,11 @@ struct HomePage { this.updateImageInfo(); } + flushPixelMapNew() { + this.isPixelMapChange = !this.isPixelMapChange; + this.updateImageInfo(); + } + updateImageInfo() { this.pixelMap.getImageInfo().then((imageInfo) => { this.imageInfo = imageInfo; -- Gitee