From 0faf1fba7ef87e848a98cb0a9e21aa711e73b0f3 Mon Sep 17 00:00:00 2001 From: TekH Date: Sat, 6 Jun 2026 12:36:00 +0200 Subject: [PATCH] Make zoom step percentage configurable Added a `ZoomStepPercentage` property to `PdfViewerOptions` to allow configurable zoom step increments (1-50, default 5%). Updated `EnvelopeViewer.razor` to use this property for the zoom slider step. Modified `pdf-viewer.js` to apply the zoom step percentage for mouse wheel zoom, `zoomIn`, and `zoomOut` methods. Included `ZoomStepPercentage` in `appsettings.json` and `setQualityOptions` for dynamic updates. Reduced `ZoomTransitionDuration` in `appsettings.json` from 900ms to 150ms for faster zoom transitions. These changes ensure consistent and customizable zoom behavior across the application. --- .../Options/PdfViewerOptions.cs | 7 +++++++ .../Pages/EnvelopeViewer.razor | 5 +++-- .../wwwroot/appsettings.json | 6 ++++-- .../wwwroot/js/pdf-viewer.js | 21 +++++++++++-------- 4 files changed, 26 insertions(+), 13 deletions(-) diff --git a/EnvelopeGenerator.ReceiverUI/Options/PdfViewerOptions.cs b/EnvelopeGenerator.ReceiverUI/Options/PdfViewerOptions.cs index 779ac6f3..3a0aec82 100644 --- a/EnvelopeGenerator.ReceiverUI/Options/PdfViewerOptions.cs +++ b/EnvelopeGenerator.ReceiverUI/Options/PdfViewerOptions.cs @@ -61,4 +61,11 @@ public class PdfViewerOptions /// Default: 50 /// public int ThumbnailRenderDelay { get; set; } = 50; + + /// + /// Zoom step percentage (1 - 50) + /// Controls how much zoom changes per click or scroll + /// Default: 5 (5% per step) + /// + public int ZoomStepPercentage { get; set; } = 5; } diff --git a/EnvelopeGenerator.ReceiverUI/Pages/EnvelopeViewer.razor b/EnvelopeGenerator.ReceiverUI/Pages/EnvelopeViewer.razor index dc4f7f2c..9af9dc61 100644 --- a/EnvelopeGenerator.ReceiverUI/Pages/EnvelopeViewer.razor +++ b/EnvelopeGenerator.ReceiverUI/Pages/EnvelopeViewer.razor @@ -98,7 +98,7 @@
- +
@(_currentZoom)%