Square-cap line endings at an angle are cropped when rendered near the edge of bounding box
Summary:
The ends of square-cap lines at an angle are cropped too much near the bounding box edges when rendered. The rendering is inconsistent between the Inkscape application and the PNG export.
Steps to reproduce:
- Open Inkscape.
- Add a line with two points at an angle with a wide stroke (45 degrees and 30 mm in the attached test file). Make sure that the end points define the bounding box.
- In "Fill and Stroke" select Square caps and Bevel join or Round join (not Miter join).
- At higher zoom-levels (around 42% for the attached file), observe:
- that the corners of the line are not rendered as square, instead being cut off inside the bounding box (cf. images below), and
- that the shown dotted bounding box does not match the bounding box of the rendered shape.
- Export drawing as PNG.
- Observe that the same line is now cropped in a different way (the lower right corner).
What happened?
Inkscape does not seem to properly render the ends of wide-stroke lines with "square caps" and "round joins" or "bevel joins" when they touch the bounding box. The following table gives an overview for a sample file (attached as test-drawing.svg) with two lines exhibiting the issue.
| Inkscape screenshot (43 % zoom) | Inkscape screenshot (118 % zoom) | Inkscape screenshot (with controls) | Inkscape PNG export | Firefox screenshot for reference | SVG file |
|---|---|---|---|---|---|
![]() |
![]() |
![]() |
![]() |
![]() |
|
The issue inkscape#894 seems like it might be related, as it describes a similar problem for paths of zero length.
What should have happened?
Other SVG renderers render the corners of the lines as square. I suppose Inkscape should do the same. For example, Firefox renders the attached test-drawing.svg as shown in the above screenshot.
Version info
Inkscape 1.4.2 (ebf0e94, 2025-05-08)
Compile (Run)
GLib version: 2.64.6
GTK version: 3.24.20 (3.24.20)
glibmm version: 2.64.2
gtkmm version: 3.24.2
libxml2 version: 2.9.10
libxslt version: 1.1.34
Cairo version: 1.16.0 (1.16.0)
Pango version: 1.44.7 (1.44.7)
HarfBuzz version: 2.6.4 (2.6.4)
OS version: Debian GNU/Linux 12 (bookworm)
(This is the most recent AppImage I could find on https://inkscape.org.)




