Quick fix for Double Renderer (#1719)

* Disable emulate comic book when on single page reader

* Fixed a regression where double page renderer wouldn't layout the images correctly
This commit is contained in:
Joe Milazzo 2023-01-02 17:00:48 -07:00 committed by GitHub
parent 23f6979dfe
commit 53c85f5f4c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 29 deletions

View File

@ -8,6 +8,10 @@
} }
} }
.image-container.full-height {
display: inline-block !important;
}
.full-width { .full-width {
width: 100%; width: 100%;
margin: 0 auto; margin: 0 auto;

View File

@ -27,6 +27,10 @@
} }
} }
.image-container.full-height {
display: inline-block;
}
.full-width { .full-width {
width: 100%; width: 100%;
margin: 0 auto; margin: 0 auto;

View File

@ -224,7 +224,7 @@
<div class="mb-3"> <div class="mb-3">
<div class="mb-3"> <div class="mb-3">
<div class="form-check form-switch"> <div class="form-check form-switch">
<input type="checkbox" id="auto-close" formControlName="autoCloseMenu" class="form-check-input" [value]="true"> <input type="checkbox" id="auto-close" formControlName="autoCloseMenu" class="form-check-input" >
<label class="form-check-label" for="auto-close">Auto Close Menu</label> <label class="form-check-label" for="auto-close">Auto Close Menu</label>
</div> </div>
</div> </div>
@ -234,7 +234,7 @@
<div class="mb-3"> <div class="mb-3">
<div class="mb-3"> <div class="mb-3">
<div class="form-check form-switch"> <div class="form-check form-switch">
<input type="checkbox" id="emulate-book" formControlName="emulateBook" class="form-check-input" [value]="true"> <input type="checkbox" id="emulate-book" formControlName="emulateBook" class="form-check-input">
<label class="form-check-label" for="emulate-book">Emulate comic book</label> <label class="form-check-label" for="emulate-book">Emulate comic book</label>
</div> </div>
</div> </div>

View File

@ -147,36 +147,12 @@ export class MangaReaderComponent implements OnInit, AfterViewInit, OnDestroy {
* @remarks Used for rendering to screen. * @remarks Used for rendering to screen.
*/ */
canvasImage = new Image(); canvasImage = new Image();
/**
* Used solely for LayoutMode.Double rendering.
* @remarks Used for rendering to screen.
*/
canvasImage2 = new Image();
/**
* Used solely for LayoutMode.Double rendering. Will always hold the previous image to canvasImage
* @see canvasImage
*/
canvasImagePrev = new Image();
/**
* Used solely for LayoutMode.Double rendering. Will always hold the next image to canvasImage
* @see canvasImage
*/
canvasImageNext = new Image();
/**
* Responsible to hold current page + 2. Used to know if we should render
* @remarks Used solely for LayoutMode.DoubleReverse rendering.
*/
canvasImageAheadBy2 = new Image();
/**
* Responsible to hold current page -2 2. Used to know if we should render
* @remarks Used solely for LayoutMode.DoubleReverse rendering.
*/
canvasImageBehindBy2 = new Image();
/** /**
* Dictates if we use render with canvas or with image. * Dictates if we use render with canvas or with image.
* @remarks This is only for Splitting. * @remarks This is only for Splitting.
*/ */
renderWithCanvas: boolean = false; //renderWithCanvas: boolean = false;
/** /**
* A circular array of size PREFETCH_PAGES. Maintains prefetched Images around the current page to load from to avoid loading animation. * A circular array of size PREFETCH_PAGES. Maintains prefetched Images around the current page to load from to avoid loading animation.
@ -468,11 +444,13 @@ export class MangaReaderComponent implements OnInit, AfterViewInit, OnDestroy {
this.generalSettingsForm.get('pageSplitOption')?.setValue(this.user.preferences.pageSplitOption); this.generalSettingsForm.get('pageSplitOption')?.setValue(this.user.preferences.pageSplitOption);
this.generalSettingsForm.get('pageSplitOption')?.enable(); this.generalSettingsForm.get('pageSplitOption')?.enable();
this.generalSettingsForm.get('fittingOption')?.enable(); this.generalSettingsForm.get('fittingOption')?.enable();
this.generalSettingsForm.get('emulateBook')?.disable();
} else { } else {
this.generalSettingsForm.get('pageSplitOption')?.setValue(PageSplitOption.NoSplit); this.generalSettingsForm.get('pageSplitOption')?.setValue(PageSplitOption.NoSplit);
this.generalSettingsForm.get('pageSplitOption')?.disable(); this.generalSettingsForm.get('pageSplitOption')?.disable();
this.generalSettingsForm.get('fittingOption')?.setValue(this.mangaReaderService.translateScalingOption(ScalingOption.FitToHeight)); this.generalSettingsForm.get('fittingOption')?.setValue(this.mangaReaderService.translateScalingOption(ScalingOption.FitToHeight));
this.generalSettingsForm.get('fittingOption')?.disable(); this.generalSettingsForm.get('fittingOption')?.disable();
this.generalSettingsForm.get('emulateBook')?.enable();
} }
this.cdRef.markForCheck(); this.cdRef.markForCheck();
@ -682,7 +660,6 @@ export class MangaReaderComponent implements OnInit, AfterViewInit, OnDestroy {
this.pagingDirectionSubject.next(PAGING_DIRECTION.FORWARD); this.pagingDirectionSubject.next(PAGING_DIRECTION.FORWARD);
this.inSetup = true; this.inSetup = true;
this.canvasImage.src = ''; this.canvasImage.src = '';
this.canvasImage2.src = '';
this.cdRef.markForCheck(); this.cdRef.markForCheck();
this.cachedImages = []; this.cachedImages = [];