File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed
Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -208,12 +208,16 @@ export class SelectedAsset extends imageAssetModule.ImageAsset {
208208 // TODO: Refactor to accomodate different scaling options
209209 // Right now, it just selects the smallest of the two sizes
210210 // and scales the image proportionally to that.
211- let targetSize = options . maxWidth < options . maxHeight ? options . maxWidth : options . maxHeight ;
212- while ( ! ( this . matchesSize ( targetSize , outWidth ) ||
213- this . matchesSize ( targetSize , outHeight ) ) ) {
214- outWidth /= 2 ;
215- outHeight /= 2 ;
216- scale *= 2 ;
211+ let targetSize = ! options . maxWidth && options . maxHeight ? options . maxHeight :
212+ ( ! options . maxHeight && options . maxWidth ? options . maxWidth :
213+ ( options . maxWidth < options . maxHeight ? options . maxWidth : options . maxHeight ) ) ;
214+ if ( targetSize ) {
215+ while ( ! ( this . matchesSize ( targetSize , outWidth ) ||
216+ this . matchesSize ( targetSize , outHeight ) ) ) {
217+ outWidth /= 2 ;
218+ outHeight /= 2 ;
219+ scale *= 2 ;
220+ }
217221 }
218222 }
219223 return scale ;
You can’t perform that action at this time.
0 commit comments