mirror of
https://github.com/drawdb-io/drawdb.git
synced 2025-09-01 10:25:13 +00:00
Increase pixel ratio for png export (#556)
This commit is contained in:
@@ -43,6 +43,7 @@ import {
|
|||||||
DB,
|
DB,
|
||||||
IMPORT_FROM,
|
IMPORT_FROM,
|
||||||
noteWidth,
|
noteWidth,
|
||||||
|
pngExportPixelRatio,
|
||||||
} from "../../data/constants";
|
} from "../../data/constants";
|
||||||
import jsPDF from "jspdf";
|
import jsPDF from "jspdf";
|
||||||
import { useHotkeys } from "react-hotkeys-hook";
|
import { useHotkeys } from "react-hotkeys-hook";
|
||||||
@@ -493,7 +494,9 @@ export default function ControlPanel({
|
|||||||
}));
|
}));
|
||||||
};
|
};
|
||||||
const copyAsImage = () => {
|
const copyAsImage = () => {
|
||||||
toPng(document.getElementById("canvas")).then(function (dataUrl) {
|
toPng(document.getElementById("canvas"), {
|
||||||
|
pixelRatio: pngExportPixelRatio,
|
||||||
|
}).then(function (dataUrl) {
|
||||||
const blob = dataURItoBlob(dataUrl);
|
const blob = dataURItoBlob(dataUrl);
|
||||||
navigator.clipboard
|
navigator.clipboard
|
||||||
.write([new ClipboardItem({ "image/png": blob })])
|
.write([new ClipboardItem({ "image/png": blob })])
|
||||||
@@ -996,7 +999,9 @@ export default function ControlPanel({
|
|||||||
{
|
{
|
||||||
name: "PNG",
|
name: "PNG",
|
||||||
function: () => {
|
function: () => {
|
||||||
toPng(document.getElementById("canvas")).then(function (dataUrl) {
|
toPng(document.getElementById("canvas"), {
|
||||||
|
pixelRatio: pngExportPixelRatio,
|
||||||
|
}).then(function (dataUrl) {
|
||||||
setExportData((prev) => ({
|
setExportData((prev) => ({
|
||||||
...prev,
|
...prev,
|
||||||
data: dataUrl,
|
data: dataUrl,
|
||||||
|
@@ -22,6 +22,7 @@ export const gridSize = 24;
|
|||||||
export const gridCircleRadius = 0.85;
|
export const gridCircleRadius = 0.85;
|
||||||
export const tableFieldHeight = 36;
|
export const tableFieldHeight = 36;
|
||||||
export const tableColorStripHeight = 7;
|
export const tableColorStripHeight = 7;
|
||||||
|
export const pngExportPixelRatio = 4;
|
||||||
|
|
||||||
export const Cardinality = {
|
export const Cardinality = {
|
||||||
ONE_TO_ONE: "one_to_one",
|
ONE_TO_ONE: "one_to_one",
|
||||||
|
Reference in New Issue
Block a user