diff --git a/Media/ImageEdit/entry/src/main/ets/pages/HomePage.ets b/Media/ImageEdit/entry/src/main/ets/pages/HomePage.ets index 9988ec0b90b9ae3ba5aab8e7fa0b2d6b748d0509..87dd665851c8014bc90054c9909d740553c5507d 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;