jgraph / drawio-desktop

Official electron build of draw.io
https://www.diagrams.net
Apache License 2.0
50.03k stars 4.97k forks source link

CLI `--crop` flag crops to much on 24.4.6 #1747

Closed leuchtum closed 4 months ago

leuchtum commented 4 months ago

Preflight Checklist

You must agree to search and the code of conduct. You must fill in this entire template. If you delete part/all or miss parts out your issue will be closed.

Describe the bug If you use the --crop flag from the CLI, drawio crops to much of the file.

To Reproduce Steps to reproduce the wrong behavior:

  1. Make sure, you are on 24.4.6
  2. Create a dummy drawio file
  3. Run drawio -x --crop dummy.drawio

Expected behavior Steps to reproduce the expected behavior:

  1. Make sure, you are NOT on 24.4.6
  2. Create a dummy drawio file
  3. Run drawio -x --crop dummy.drawio

Screenshots DRAWIO dummy file Bildschirmfoto 2024-05-23 um 18 47 44 CORRECT PDF Bildschirmfoto 2024-05-23 um 18 47 59 BUGGED PDF Bildschirmfoto 2024-05-23 um 18 49 38

draw.io version (In the Help->About menu of the draw.io editor):

> drawio --version
24.4.6

Desktop (please complete the following information):

> sw_vers
ProductName:        macOS
ProductVersion:     14.4.1
BuildVersion:       23E224

Additional context NA

JeroenGar commented 4 months ago

i am experiencing similar behaviour on 24.4.8. Exports seem to be consistently cropped a little too aggressively:

Untitled 2

alderg commented 4 months ago

@JeroenGar Please include a test case and your operating system and version.

JeroenGar commented 4 months ago

Here is the XML inside the .drawio file. Should contain all necessary information to replicate.

<mxfile host="Electron" modified="2024-05-29T14:57:03.782Z" agent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/24.4.8 Chrome/124.0.6367.207 Electron/30.0.6 Safari/537.36" etag="Go8-mUapq2995YPCXtlk" version="24.4.8" type="device">
  <diagram name="Page-1" id="q1JSyBGCea1ykbwNZwou">
    <mxGraphModel dx="1026" dy="669" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1169" pageHeight="827" math="0" shadow="0">
      <root>
        <mxCell id="0" />
        <mxCell id="1" parent="0" />
        <mxCell id="qXMOj-TNuEZGjjNJlyur-1" value="" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;fillColor=#f5f5f5;fontColor=#333333;strokeColor=#666666;" vertex="1" parent="1">
          <mxGeometry x="240" y="250" width="30" height="30" as="geometry" />
        </mxCell>
        <mxCell id="qXMOj-TNuEZGjjNJlyur-2" value="" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;fillColor=#f5f5f5;fontColor=#333333;strokeColor=#666666;" vertex="1" parent="1">
          <mxGeometry x="450" y="40" width="30" height="30" as="geometry" />
        </mxCell>
        <mxCell id="qXMOj-TNuEZGjjNJlyur-3" value="" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;fillColor=#f5f5f5;fontColor=#333333;strokeColor=#666666;" vertex="1" parent="1">
          <mxGeometry x="450" y="250" width="30" height="30" as="geometry" />
        </mxCell>
        <mxCell id="qXMOj-TNuEZGjjNJlyur-4" value="" style="ellipse;whiteSpace=wrap;html=1;aspect=fixed;fillColor=#f5f5f5;fontColor=#333333;strokeColor=#666666;" vertex="1" parent="1">
          <mxGeometry x="240" y="40" width="30" height="30" as="geometry" />
        </mxCell>
      </root>
    </mxGraphModel>
  </diagram>
</mxfile>

Running draw.io -x --crop yields this pdf: test_case.pdf You will see that both the bottom and left side are cropped too much. Same behaviour as the original example by @leuchtum.

davidjgraph commented 4 months ago

Fix in 24.4.13.