-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: improve save as PNG, SVG and copy to clipboard #3252
Conversation
Deploying nmrium with
|
Latest commit: |
0d7c476
|
Status: | ✅ Deploy successful! |
Preview URL: | https://b6c1ab5c.nmrium.pages.dev |
Branch Preview URL: | https://improve-save-as-image.nmrium.pages.dev |
2fa4955
to
76a9a00
Compare
Default in 'cm'. There should be a simple mode in which the user select a size (default to A5) and a resolution (default to 300 DPI). From those values we can calculate the number of HORIZONTAL pixels. A5 is 8.3 x 5.8 this means 2490 x 1740 px. If we have for example on the screen 1027 x 853 we need to call the method:
We need a new SVG with the correct ratio. We don't change the width but we change only the height. New height = 1740 / 2490 * 1027 = 718 px. So we create the SVG with 1027 x 853. Now we need to calculate the scale factor: Scale factor: 2490 / 1027 = 2.42 |
57b70e9
to
934c4c8
Compare
Could you still add shortcuts so that 'ENTER' validates the dialog and 'ESC' cancel it ? |
69ab531
to
f419002
Compare
f419002
to
e6ffc87
Compare
Browsers have limits on the maximum size of a canvas, These limits differ by browser, Chrome's maximum canvas size is 16,384 x 16,384 pixels.
Chrome:
Maximum height/width: 32,767 pixels
Maximum area: 268,435,456 pixels ( 16,384 x 16,384)
Firefox:
Maximum height/width: 32,767 pixels
Maximum area: 472,907,776 pixels ( 22,528 x 20,992)