Exported SVG Rect with scooped corners, invalid

<rect transform="translate(496,422)" style="stroke:#000000;stroke-width:0.05mm;fill:none" x="-263" y="-215" width="526" height="430" rx="-60"/>

The SVG 2.0 spec says this is “A negative value for rx must be treated as an illegal value.” which means the rect should not be displayed. The newest editors draft says “A negative value for rx is invalid and must be ignored.” which means draw the rectangle but ignore the invalid corners.

Strictly speaking this rect is invalid and no software should display it, or if it does, it should do so without the rounded rect.

Properly in svg you would need to decompose the rectangle ( Basic Shapes — SVG 2) and if there is a negative rx value, flip the sweep flag take the absolute value of the rx, ry after clamping.

  • moveto x+abs(rx),y
  • horizontal lineto x+width-abs(rx)
  • elliptical arcto x+width,y+abs(ry), rotation=0, large-arc=0, sweep=scooped
  • vertical lineto y+height-abs(ry)
  • elliptical arcto x+width-abs(rx), y+height, rotation=0, large-arc=0, sweep=scooped
  • horizontal lineto `x+abs(rx)
  • elliptical arcto x,y+height-abs(ry) rotation=0, large-arc=0, sweep=scooped
  • vertical lineto y+abs(ry)
  • elliptical arcto x+abs(rx),y rotation=0, large-arc=0, sweep=scooped
  • close

@Tatarize thank you for pointing that out. I’ve updated the SVG import code to discard negative rx/ry values.
We’ve also changed the SVG export to convert LightBurn rects with negative corner radii to be exported as a path to preserve those inverted corners (since they are valid in LightBurn).

Both changes will be included in the next release.