From 979e02cb41d2db7da3ceeed940f1d2fbca4af9a2 Mon Sep 17 00:00:00 2001 From: Denys Vuika Date: Tue, 12 Dec 2023 09:32:29 -0500 Subject: [PATCH] reduce duplicated code --- .../src/lib/viewer/components/pdf-viewer.component.ts | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/lib/core/src/lib/viewer/components/pdf-viewer.component.ts b/lib/core/src/lib/viewer/components/pdf-viewer.component.ts index 3acd35d89d9..0a19603bc82 100644 --- a/lib/core/src/lib/viewer/components/pdf-viewer.component.ts +++ b/lib/core/src/lib/viewer/components/pdf-viewer.component.ts @@ -303,7 +303,8 @@ export class PdfViewerComponent implements OnChanges, OnDestroy { let scale: number; switch (this.currentScaleMode) { - case 'init': { + case 'init': + case 'page-fit': { scale = this.getUserScaling(); if (!scale) { scale = this.autoScaling(pageHeightScale, pageWidthScale); @@ -322,13 +323,6 @@ export class PdfViewerComponent implements OnChanges, OnDestroy { scale = pageHeightScale; break; } - case 'page-fit': { - scale = this.getUserScaling(); - if (!scale) { - scale = this.autoScaling(pageHeightScale, pageWidthScale); - } - break; - } case 'auto': { scale = this.autoScaling(pageHeightScale, pageWidthScale); break;