From d2646b5ad49994f68f686e52ba1531f781a232d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=94=B0=E5=8F=8C=E6=98=8E?= Date: Thu, 10 Oct 2024 09:07:38 +0000 Subject: [PATCH] update library/src/main/ets/downsampling/DownsampleStartegy.ets. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 田双明 --- .../main/ets/downsampling/DownsampleStartegy.ets | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/library/src/main/ets/downsampling/DownsampleStartegy.ets b/library/src/main/ets/downsampling/DownsampleStartegy.ets index 8fe9694..65d1c16 100644 --- a/library/src/main/ets/downsampling/DownsampleStartegy.ets +++ b/library/src/main/ets/downsampling/DownsampleStartegy.ets @@ -101,7 +101,6 @@ export class CenterInside implements BaseDownsampling { getScaleFactor(sourceWidth: number, sourceHeight: number, requestedWidth: number, requestedHeight: number, downsampType: DownsampleStrategy ): number { - let outSize: Size = { width: round(Math.min(1, getScale(sourceWidth, sourceHeight, requestedWidth, requestedHeight, downsampType)) * sourceWidth), height:round(Math.min(1, getScale(sourceWidth, sourceHeight, requestedWidth, requestedHeight, downsampType)) * sourceHeight) @@ -127,17 +126,7 @@ export class CenterInside implements BaseDownsampling { return SampleSizeRounding.QUALITY } //否则,使用 FIL_CENTER 的 SampleSizeRounding 值 - return this.getSampleSize(sourceWidth, sourceHeight, requestedWidth, requestedHeight, downsampType); - } - - getSampleSize(sourceWidth: number, sourceHeight: number, requestedWidth: number, requestedHeight: number, - downsampType: DownsampleStrategy - ): SampleSizeRounding { - if (downsampType === DownsampleStrategy.CENTER_INSIDE_MEMORY) { - return SampleSizeRounding.MEMORY; - } else { - return SampleSizeRounding.QUALITY; - } + return downsampType === DownsampleStrategy.CENTER_INSIDE_MEMORY?SampleSizeRounding.MEMORY:SampleSizeRounding.QUALITY } }