Make ZoomPercent a public parameter in SenderPdfEditor
Refactored the `ZoomPercent` property in `SenderPdfImageEditor.razor` to be a public parameter, enabling external control of the zoom level. Removed the private `_zoomPercent` field and updated all references to use the new parameter. Updated the `SetZoomPercent` method to modify the `ZoomPercent` parameter. Adjusted `SenderPdfImageEditorToolbar` to accept `ZoomPercent` as a parameter. In `CreateEnvelopeWizardPopup.razor`, added the `ZoomPercent` parameter to the `SenderPdfImageEditor` component with a default value of `100`.
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
<div class="sender-image-editor__toolbar-host">
|
||||
<SenderPdfImageEditorToolbar CurrentPage="@_currentPage"
|
||||
TotalPages="@PageCount"
|
||||
ZoomPercent="@_zoomPercent"
|
||||
ZoomPercent="@ZoomPercent"
|
||||
MinZoomPercent="@MinZoomPercent"
|
||||
MaxZoomPercent="@MaxZoomPercent"
|
||||
ZoomStepPercent="@ZoomStepPercent"
|
||||
@@ -195,7 +195,9 @@
|
||||
private double _grabOffsetXPt;
|
||||
private double _grabOffsetYPt;
|
||||
private int _currentPage = 1;
|
||||
private int _zoomPercent = 180;
|
||||
[Parameter]
|
||||
public int ZoomPercent { get; set; } = 180;
|
||||
|
||||
private bool _zoomOverrideInitialized;
|
||||
private bool _isDownloading;
|
||||
private bool _isPrinting;
|
||||
@@ -268,7 +270,7 @@
|
||||
|
||||
private string GetZoomStyle()
|
||||
{
|
||||
var factor = (_zoomPercent / 100.0).ToString("F4", CultureInfo.InvariantCulture);
|
||||
var factor = (ZoomPercent / 100.0).ToString("F4", CultureInfo.InvariantCulture);
|
||||
return $"--sender-editor-zoom:{factor};";
|
||||
}
|
||||
|
||||
@@ -456,13 +458,13 @@
|
||||
|
||||
private async Task OnZoomOutAsync()
|
||||
{
|
||||
SetZoomPercent(_zoomPercent - ZoomStepPercent);
|
||||
SetZoomPercent(ZoomPercent - ZoomStepPercent);
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
|
||||
private async Task OnZoomInAsync()
|
||||
{
|
||||
SetZoomPercent(_zoomPercent + ZoomStepPercent);
|
||||
SetZoomPercent(ZoomPercent + ZoomStepPercent);
|
||||
await InvokeAsync(StateHasChanged);
|
||||
}
|
||||
|
||||
@@ -495,7 +497,7 @@
|
||||
|
||||
private void SetZoomPercent(int value)
|
||||
{
|
||||
_zoomPercent = Math.Max(MinZoomPercent, Math.Min(value, MaxZoomPercent));
|
||||
ZoomPercent = Math.Max(MinZoomPercent, Math.Min(value, MaxZoomPercent));
|
||||
}
|
||||
|
||||
private async Task OnDownloadPdfAsync()
|
||||
|
||||
Reference in New Issue
Block a user