File tree Expand file tree Collapse file tree 1 file changed +2
-5
lines changed
Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -168,11 +168,8 @@ class MediaPreviewThumbnail extends globalThis.HTMLElement {
168168 const minRatioX = parseInt ( minWidth ) / w ;
169169 const minRatioY = parseInt ( minHeight ) / h ;
170170
171- const isScalingDownX = maxRatioX < 1 ;
172- const isScalingDownY = maxRatioY < 1 ;
173-
174- scaleX = isScalingDownX ? maxRatioX : minRatioX > 1 ? minRatioX : 1 ;
175- scaleY = isScalingDownY ? maxRatioY : minRatioY > 1 ? minRatioY : 1 ;
171+ scaleX = maxRatioX < 1 ? maxRatioX : Math . max ( maxRatioX , minRatioX ) ;
172+ scaleY = maxRatioY < 1 ? maxRatioY : Math . max ( maxRatioY , minRatioY ) ;
176173 } else {
177174 const maxRatio = Math . min ( parseInt ( maxWidth ) / w , parseInt ( maxHeight ) / h ) ;
178175 const minRatio = Math . max ( parseInt ( minWidth ) / w , parseInt ( minHeight ) / h ) ;
You can’t perform that action at this time.
0 commit comments