Skip to content

Commit

Permalink
bug: no maxWidth on wide image in clamped mode
Browse files Browse the repository at this point in the history
  • Loading branch information
mienaiyami committed Oct 28, 2022
1 parent 6106680 commit c1a62c6
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/Components/Reader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,8 @@ const Reader = () => {
className={
"row " +
(wideImageContMap.includes(i) ? "wide " : "") +
(appSettings.readerSettings.pagesPerRowSelected !== 0 ? "twoPagePerRow " : "")
(appSettings.readerSettings.pagesPerRowSelected !== 0 ? "twoPagePerRow " : "") +
(appSettings.readerSettings.widthClamped ? "widthClamped " : "")
}
data-imagerow={i + 1}
style={{
Expand Down
23 changes: 20 additions & 3 deletions src/styles/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -999,21 +999,38 @@ body {
}
img {
width: var(--varWidth);
// max-width: 100%;
max-width: 500%;
// min-width: 1%;
// image-rendering: pixelated;
}
&.widthClamped {
img {
max-width: 100%;
}
}
&.twoPagePerRow {
img {
max-width: 50%;
max-width: 250%;
width: calc(var(--varWidth) / 2);
}
&.wide {
img {
max-width: 100%;
max-width: 500%;
width: var(--varWidth);
}
}
&.widthClamped {
img {
max-width: 50%;
width: calc(var(--varWidth) / 2);
}
&.wide {
img {
max-width: 100%;
width: var(--varWidth);
}
}
}
}
}
}
Expand Down

0 comments on commit c1a62c6

Please sign in to comment.