Resize images properly to set reader width

Images didn't shrink in size while the reader width was set and the original size was used
This commit is contained in:
schroda
2024-12-17 00:59:18 +01:00
parent 33b756219b
commit 38bcf4aecc

View File

@@ -151,6 +151,10 @@ export const getImageWidthStyling = (
switch (pageScaleMode) {
case ReaderPageScaleMode.WIDTH:
return {
minWidth: 0,
...applyStyles(isContinuousReadingMode(readingMode), {
minWidth: 'unset',
}),
...applyStyles(shouldStretchPage, {
minWidth: width,
...readerWidthStretchForWrapper,
@@ -160,6 +164,10 @@ export const getImageWidthStyling = (
};
case ReaderPageScaleMode.HEIGHT:
return {
minHeight: 0,
...applyStyles(isContinuousReadingMode(readingMode), {
minHeight: 'unset',
}),
...applyStyles(shouldStretchPage, {
minHeight: '100%',
}),
@@ -167,6 +175,12 @@ export const getImageWidthStyling = (
};
case ReaderPageScaleMode.SCREEN:
return {
minWidth: 0,
minHeight: 0,
...applyStyles(isContinuousReadingMode(readingMode), {
minWidth: 'unset',
minHeight: 'unset',
}),
...applyStyles(shouldStretchPage, {
minWidth: width,
minHeight: '100%',