The math here is quite forgiving

This commit is contained in:
Lim Chee Aun 2024-06-19 23:34:19 +08:00
parent a6e6a7d741
commit 527a1551cf

View file

@ -375,7 +375,7 @@ function Media({
const displayNaturalHeight =
(naturalHeight * clientWidth) / naturalWidth;
const almostSimilarHeight =
Math.abs(displayNaturalHeight - clientHeight) < 2;
Math.abs(displayNaturalHeight - clientHeight) < 5;
if (almostSimilarHeight) {
setHasNaturalAspectRatio(true);