From aed44a4afef4de20f3f4e8dda9d7c43113b40f93 Mon Sep 17 00:00:00 2001 From: dodozhou7 Date: Wed, 17 Aug 2022 23:31:07 -0700 Subject: [PATCH] 1.fix lint error,cannot use width & height as properties. Signed-off-by: dodozhou7 --- entry/src/main/ets/pages/cropImagePage2.ets | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/entry/src/main/ets/pages/cropImagePage2.ets b/entry/src/main/ets/pages/cropImagePage2.ets index 2359aed..02e1a06 100644 --- a/entry/src/main/ets/pages/cropImagePage2.ets +++ b/entry/src/main/ets/pages/cropImagePage2.ets @@ -29,8 +29,8 @@ export struct CropImagePage2 { @State options1: PixelMapCrop.Options = new PixelMapCrop.Options(); @State cropTap: boolean = false; @State pack: PixelMapPack = new PixelMapPack(); - @State width: number = 0; - @State height: number = 0; + @State width1: number = 0; + @State height1: number = 0; @State _rotate: number = 0; @State _scale: number = 1; private _resource: Resource = $r('app.media.bmpNet'); @@ -54,8 +54,8 @@ export struct CropImagePage2 { let pack1 = new PixelMapPack(); pack1.pixelMap = pixelmap; this.pack = pack1; - this.width = sx * px2vp(1); - this.height = sy * px2vp(1); + this.width1 = sx * px2vp(1); + this.height1 = sy * px2vp(1); } @@ -77,13 +77,13 @@ export struct CropImagePage2 { Image(this.pack.pixelMap) - .width(this.width) - .height(this.height) + .width(this.width1) + .height(this.height1) .objectFit(ImageFit.Contain) .rotate({ z: 1, - centerX: this.width / 2, - centerY: this.height / 2, + centerX: this.width1 / 2, + centerY: this.height1 / 2, angle: this._rotate }) .scale({ x: this._scale, y: this._scale, z: 1.0 })