Increase max zoom and improve zoom styling
Increased the maximum zoom percentage (`MaxZoomPercent`) in `SenderPdfImageEditor.razor` from 300 to 1000, enabling higher zoom levels for PDFs. Updated the `GetZoomStyle` method to use a CSS variable (`--sender-editor-zoom`) for better flexibility and consistency in applying zoom styles. Introduced the `--sender-editor-zoom` CSS variable in `envelope-viewer.css` and replaced the `max-width` property with a dynamic `width` calculation to ensure zoom levels affect the editor's layout.
This commit is contained in:
@@ -203,7 +203,7 @@
|
|||||||
private ActiveFieldScrollTarget? _pendingActiveFieldScrollTarget;
|
private ActiveFieldScrollTarget? _pendingActiveFieldScrollTarget;
|
||||||
|
|
||||||
private const int MinZoomPercent = 50;
|
private const int MinZoomPercent = 50;
|
||||||
private const int MaxZoomPercent = 300;
|
private const int MaxZoomPercent = 1000;
|
||||||
private const int ZoomStepPercent = 5;
|
private const int ZoomStepPercent = 5;
|
||||||
private bool CanDownloadPdf => !string.IsNullOrWhiteSpace(PdfDataUrl);
|
private bool CanDownloadPdf => !string.IsNullOrWhiteSpace(PdfDataUrl);
|
||||||
private bool CanPrintPdf => !string.IsNullOrWhiteSpace(PdfDataUrl);
|
private bool CanPrintPdf => !string.IsNullOrWhiteSpace(PdfDataUrl);
|
||||||
@@ -269,7 +269,7 @@
|
|||||||
private string GetZoomStyle()
|
private string GetZoomStyle()
|
||||||
{
|
{
|
||||||
var factor = (_zoomPercent / 100.0).ToString("F4", CultureInfo.InvariantCulture);
|
var factor = (_zoomPercent / 100.0).ToString("F4", CultureInfo.InvariantCulture);
|
||||||
return $"zoom:{factor};";
|
return $"--sender-editor-zoom:{factor};";
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnParametersSet()
|
protected override void OnParametersSet()
|
||||||
|
|||||||
@@ -274,7 +274,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.sender-image-editor__pages {
|
.sender-image-editor__pages {
|
||||||
max-width: 1040px;
|
--sender-editor-zoom: 1;
|
||||||
|
width: calc(min(1040px, 100%) * var(--sender-editor-zoom));
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|||||||
Reference in New Issue
Block a user