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:
@@ -151,6 +151,10 @@ export const getImageWidthStyling = (
|
|||||||
switch (pageScaleMode) {
|
switch (pageScaleMode) {
|
||||||
case ReaderPageScaleMode.WIDTH:
|
case ReaderPageScaleMode.WIDTH:
|
||||||
return {
|
return {
|
||||||
|
minWidth: 0,
|
||||||
|
...applyStyles(isContinuousReadingMode(readingMode), {
|
||||||
|
minWidth: 'unset',
|
||||||
|
}),
|
||||||
...applyStyles(shouldStretchPage, {
|
...applyStyles(shouldStretchPage, {
|
||||||
minWidth: width,
|
minWidth: width,
|
||||||
...readerWidthStretchForWrapper,
|
...readerWidthStretchForWrapper,
|
||||||
@@ -160,6 +164,10 @@ export const getImageWidthStyling = (
|
|||||||
};
|
};
|
||||||
case ReaderPageScaleMode.HEIGHT:
|
case ReaderPageScaleMode.HEIGHT:
|
||||||
return {
|
return {
|
||||||
|
minHeight: 0,
|
||||||
|
...applyStyles(isContinuousReadingMode(readingMode), {
|
||||||
|
minHeight: 'unset',
|
||||||
|
}),
|
||||||
...applyStyles(shouldStretchPage, {
|
...applyStyles(shouldStretchPage, {
|
||||||
minHeight: '100%',
|
minHeight: '100%',
|
||||||
}),
|
}),
|
||||||
@@ -167,6 +175,12 @@ export const getImageWidthStyling = (
|
|||||||
};
|
};
|
||||||
case ReaderPageScaleMode.SCREEN:
|
case ReaderPageScaleMode.SCREEN:
|
||||||
return {
|
return {
|
||||||
|
minWidth: 0,
|
||||||
|
minHeight: 0,
|
||||||
|
...applyStyles(isContinuousReadingMode(readingMode), {
|
||||||
|
minWidth: 'unset',
|
||||||
|
minHeight: 'unset',
|
||||||
|
}),
|
||||||
...applyStyles(shouldStretchPage, {
|
...applyStyles(shouldStretchPage, {
|
||||||
minWidth: width,
|
minWidth: width,
|
||||||
minHeight: '100%',
|
minHeight: '100%',
|
||||||
|
|||||||
Reference in New Issue
Block a user