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 } }