Skip to content

Commit 577e8a0

Browse files
committed
issue #653: fix issue to calculate when picture width exceeds container width
1 parent dcb6fdd commit 577e8a0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/components/ArticleV3/ArticleCellFigure.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ const ArticleCellFigure = ({
5454
const aspectRatio = getFigureRatio(tags);
5555
const figureHeight = useFigureHeight(tags, !aspectRatio, figure.isCover);
5656
const containerWidth = useContainerWidth(pictureRef);
57-
const shouldUseFixedHeight = figureHeight && (!figure.isCover || !aspectRatio) && (figureHeight * aspectRatio) <= containerWidth;
57+
const shouldUseFixedHeight = figureHeight && (!figure.isCover || !aspectRatio) && (figureHeight / aspectRatio) <= containerWidth;
5858

5959
const { height: windowHeight } = useWindowSize();
6060

0 commit comments

Comments
 (0)