File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ import {
43
43
DB ,
44
44
IMPORT_FROM ,
45
45
noteWidth ,
46
+ pngExportPixelRatio ,
46
47
} from "../../data/constants" ;
47
48
import jsPDF from "jspdf" ;
48
49
import { useHotkeys } from "react-hotkeys-hook" ;
@@ -493,7 +494,9 @@ export default function ControlPanel({
493
494
} ) ) ;
494
495
} ;
495
496
const copyAsImage = ( ) => {
496
- toPng ( document . getElementById ( "canvas" ) ) . then ( function ( dataUrl ) {
497
+ toPng ( document . getElementById ( "canvas" ) , {
498
+ pixelRatio : pngExportPixelRatio ,
499
+ } ) . then ( function ( dataUrl ) {
497
500
const blob = dataURItoBlob ( dataUrl ) ;
498
501
navigator . clipboard
499
502
. write ( [ new ClipboardItem ( { "image/png" : blob } ) ] )
@@ -996,7 +999,9 @@ export default function ControlPanel({
996
999
{
997
1000
name : "PNG" ,
998
1001
function : ( ) => {
999
- toPng ( document . getElementById ( "canvas" ) ) . then ( function ( dataUrl ) {
1002
+ toPng ( document . getElementById ( "canvas" ) , {
1003
+ pixelRatio : pngExportPixelRatio ,
1004
+ } ) . then ( function ( dataUrl ) {
1000
1005
setExportData ( ( prev ) => ( {
1001
1006
...prev ,
1002
1007
data : dataUrl ,
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ export const gridSize = 24;
22
22
export const gridCircleRadius = 0.85 ;
23
23
export const tableFieldHeight = 36 ;
24
24
export const tableColorStripHeight = 7 ;
25
+ export const pngExportPixelRatio = 4 ;
25
26
26
27
export const Cardinality = {
27
28
ONE_TO_ONE : "one_to_one" ,
You can’t perform that action at this time.
0 commit comments