Skip to content

Commit

Permalink
reduce duplicated code
Browse files Browse the repository at this point in the history
  • Loading branch information
DenysVuika committed Dec 12, 2023
1 parent 8298045 commit 979e02c
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions lib/core/src/lib/viewer/components/pdf-viewer.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;
Expand Down

0 comments on commit 979e02c

Please sign in to comment.