From cb9804e1ee8ee4ca3248e7e3f0427c1646514706 Mon Sep 17 00:00:00 2001 From: isamu Date: Thu, 21 Dec 2023 09:13:38 +0900 Subject: [PATCH] Fixed cover image size in measureImageWithDimensions. --- src/DocMeasure.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/DocMeasure.js b/src/DocMeasure.js index 87892281b..f05005ca4 100644 --- a/src/DocMeasure.js +++ b/src/DocMeasure.js @@ -85,6 +85,9 @@ class DocMeasure { let factor = (dimensions.width / dimensions.height > node.fit[0] / node.fit[1]) ? node.fit[0] / dimensions.width : node.fit[1] / dimensions.height; node._width = node._minWidth = node._maxWidth = dimensions.width * factor; node._height = dimensions.height * factor; + } else if (node.cover) { + node._width = node._minWidth = node._maxWidth = node.cover.width; + node._height = node._minHeight = node._maxHeight = node.cover.height; } else { node._width = node._minWidth = node._maxWidth = node.width || dimensions.width; node._height = node.height || (dimensions.height * node._width / dimensions.width);