diff options
| author | John MacFarlane <[email protected]> | 2023-07-26 09:49:37 -0600 |
|---|---|---|
| committer | John MacFarlane <[email protected]> | 2023-07-26 09:49:37 -0600 |
| commit | ecb59e1cdef1e32d0dfc71412ef72a3affc016f4 (patch) | |
| tree | bb58b277148e60ab98a6a8c2c961c240954c0053 /src | |
| parent | d7c43fda32b3cedc362196d0fc4d09aa4770841a (diff) | |
SelfContained: fix calculation of svg width and height.
We were computing width and height from viewBox incorrectly.
See #8969.
Diffstat (limited to 'src')
| -rw-r--r-- | src/Text/Pandoc/SelfContained.hs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Text/Pandoc/SelfContained.hs b/src/Text/Pandoc/SelfContained.hs index 428a18f0f..9e07f8850 100644 --- a/src/Text/Pandoc/SelfContained.hs +++ b/src/Text/Pandoc/SelfContained.hs @@ -213,11 +213,11 @@ combineSvgAttrs svgAttrs imgAttrs = case (mbViewBox, mbHeight, mbWidth) of (Nothing, Just h, Just w) -> -- calculate viewBox combinedAttrs ++ [("viewBox", T.unwords ["0", "0", tshow w, tshow h])] - (Just (llx,lly,urx,ury), Nothing, Nothing) -> -- calculate width, height + (Just (_minx,_miny,width,height), Nothing, Nothing) -> combinedAttrs ++ - [ ("width", tshow (floor urx - floor llx :: Int)) | + [ ("width", tshow (floor width :: Int)) | isNothing (lookup "width" combinedAttrs) ] ++ - [ ("height", tshow (floor ury - floor lly :: Int)) | + [ ("height", tshow (floor height :: Int)) | isNothing (lookup "height" combinedAttrs) ] _ -> combinedAttrs where |
