diff --git a/booklore-ui/src/app/features/settings/reader-preferences/epub-reader-preferences/epub-reader-preferences-component.html b/booklore-ui/src/app/features/settings/reader-preferences/epub-reader-preferences/epub-reader-preferences-component.html index 3c02e51d0..de9d99f23 100644 --- a/booklore-ui/src/app/features/settings/reader-preferences/epub-reader-preferences/epub-reader-preferences-component.html +++ b/booklore-ui/src/app/features/settings/reader-preferences/epub-reader-preferences/epub-reader-preferences-component.html @@ -245,7 +245,7 @@
- {{ gap }}px + {{ gap * 100 | number : '1.0-0' }}%
diff --git a/booklore-ui/src/app/features/settings/reader-preferences/epub-reader-preferences/epub-reader-preferences-component.ts b/booklore-ui/src/app/features/settings/reader-preferences/epub-reader-preferences/epub-reader-preferences-component.ts index c3686f9c9..680c9a432 100644 --- a/booklore-ui/src/app/features/settings/reader-preferences/epub-reader-preferences/epub-reader-preferences-component.ts +++ b/booklore-ui/src/app/features/settings/reader-preferences/epub-reader-preferences/epub-reader-preferences-component.ts @@ -1,3 +1,4 @@ +import {DecimalPipe} from '@angular/common'; import {Component, inject, Input, OnDestroy, OnInit} from '@angular/core'; import {Button} from 'primeng/button'; import {FormsModule} from '@angular/forms'; @@ -16,6 +17,7 @@ import {themes} from '../../../readers/ebook-reader/state/themes.constant'; selector: 'app-epub-reader-preferences-component', imports: [ Button, + DecimalPipe, FormsModule, TranslocoDirective, Tooltip, @@ -249,25 +251,26 @@ export class EpubReaderPreferencesComponent implements OnInit, OnDestroy { increaseLineHeight() { if (this.lineHeight < 3) { - this.lineHeight += 0.1; + this.lineHeight = Math.round((this.lineHeight + 0.1) * 10) / 10; } } decreaseLineHeight() { if (this.lineHeight > 1) { - this.lineHeight -= 0.1; + this.lineHeight = Math.round((this.lineHeight - 0.1) * 10) / 10; } } increaseGap() { - if (this.gap < 100) { - this.gap += 5; + + if (this.gap < 0.5) { + this.gap = Math.round((this.gap + 0.05) * 100) / 100; } } decreaseGap() { if (this.gap > 0) { - this.gap -= 5; + this.gap = Math.round((this.gap - 0.05) * 100) / 100; } }