Skip to content

Commit

Permalink
fix(ui): more PNG export resolution improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
a-asaad committed Sep 6, 2024
1 parent f230e8d commit 049fa5a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ui/src/components/options-menu/ExportPng.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { forwardRef } from "react"
import { getNodesBounds, getViewportForBounds } from "reactflow"
import { useAppActions, useGetNodes } from "../../singletons/store"

const IMAGE_PADDING = 200
const SCALING_FACTOR = 1.20

const downloadImage = (dataUrl: string) => {
const a = document.createElement("a")
Expand All @@ -24,8 +24,8 @@ const ExportPng = forwardRef<HTMLElement>(
const handleClick = () => {
clearDiagramSelections()
const nodeBounds = getNodesBounds(nodes)
const imageWidth = nodeBounds.width + IMAGE_PADDING
const imageHeight = nodeBounds.height + IMAGE_PADDING
const imageWidth = nodeBounds.width * SCALING_FACTOR
const imageHeight = nodeBounds.height * SCALING_FACTOR
const transform = getViewportForBounds(
nodeBounds,
imageWidth,
Expand Down

0 comments on commit 049fa5a

Please sign in to comment.