update library/src/main/ets/downsampling/DownsampleStartegy.ets.
Signed-off-by: 田双明 <tianshuangming@h-partners.com>
This commit is contained in:
parent
c79046f005
commit
d2646b5ad4
|
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue