feat(webreader): fit width (shrink only) scale type

closes #584
This commit is contained in:
Gauthier Roebroeck 2021-09-06 16:50:17 +08:00
parent fe2b756c2f
commit 9e9033dc0e
3 changed files with 15 additions and 1 deletions

View file

@ -201,6 +201,8 @@ export default Vue.extend({
switch (this.scale) {
case ScaleType.WIDTH:
return double ? 'img-double-fit-width' : 'img-fit-width'
case ScaleType.WIDTH_SHRINK_ONLY:
return double ? 'img-double-fit-width-shrink-only' : 'img-fit-width-shrink-only'
case ScaleType.HEIGHT:
return 'img-fit-height'
case ScaleType.SCREEN:
@ -331,6 +333,16 @@ export default Vue.extend({
align-self: flex-start;
}
.img-fit-width-shrink-only {
max-width: 100vw;
align-self: flex-start;
}
.img-double-fit-width-shrink-only {
max-width: 50vw;
align-self: flex-start;
}
.img-fit-original {
width: auto;
height: auto;

View file

@ -98,7 +98,8 @@
"height": "Fit height",
"original": "Original",
"screen": "Screen",
"width": "Fit width"
"width": "Fit width",
"width_shrink_only": "Fit width (shrink only)"
},
"settings": {
"always_fullscreen": "Always Full Screen",

View file

@ -3,6 +3,7 @@
export enum ScaleType {
SCREEN = 'bookreader.scale_type.screen',
WIDTH = 'bookreader.scale_type.width',
WIDTH_SHRINK_ONLY = 'bookreader.scale_type.width_shrink_only',
HEIGHT = 'bookreader.scale_type.height',
ORIGINAL = 'bookreader.scale_type.original'
}