From 3c57011f0c35146c4d3b48e83805f8392fd9f12c Mon Sep 17 00:00:00 2001 From: schroda <50052685+schroda@users.noreply.github.com> Date: Fri, 27 Dec 2024 20:59:17 +0100 Subject: [PATCH] Fix margin of double pages with set reader width Depending on the set reader width, the auto margin of the images took effect and separated the double pages. However, for double pages, only the margin left/right depending on the page should be set, to properly center the pages without a gap between them --- src/modules/reader/utils/ReaderPager.utils.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/modules/reader/utils/ReaderPager.utils.tsx b/src/modules/reader/utils/ReaderPager.utils.tsx index e7db009c..aa08b830 100644 --- a/src/modules/reader/utils/ReaderPager.utils.tsx +++ b/src/modules/reader/utils/ReaderPager.utils.tsx @@ -213,6 +213,7 @@ export const getImageWidthStyling = ( export const getImageMarginStyling = (doublePage: boolean, objectFitPosition?: 'left' | 'right'): CSSObject => ({ m: 'auto', ...applyStyles(doublePage, { + m: 'unset', // the applied margin is the opposite of the objectFitPosition ...applyStyles(objectFitPosition === 'right', { ml: 'auto ' }), ...applyStyles(objectFitPosition === 'left', { mr: 'auto ' }),