Bounding box of some 0 length paths with 3+ nodes miscalculated

Migrated from https://bugs.launchpad.net/inkscape/+bug/1778145 Part 2/2

Steps to reproduce:

  • open Inkscape
  • open file
    inkscape_artifacts_save_to_PDF_too.svg
  • try to select one of the circles

What happened?

You can't select them, unless you lasso-select them AND include the bottom right corner (becomes bottom left corner after deleting the layer transform) in the lasso.

Then you see that their bounding box includes the bottom right of the page.

What should have happened?

The circles should have a regular bounding box.

Inspecting the paths shows their d attribute similar to: m -65.29917,-48.429452 v 0 0, so a moveto command followed by a vertical lineto with two attributes, which is legal, but unnecessary. It is possble to create these paths in Inkscape directly, see #1675 (closed).

Paths of type m -65.29917,-48.429452 l 0 0 are unaffected.

Inkscape Version and Operating System:

  • Inkscape Version: 1.1-dev (2a5d477, 2020-01-18)
  • Operating System: Windows 10
  • Operating System version: 10.0.18362

Summary of comments: Replicated in:

  • 0.91 r13725 (Jan 30 2015)
  • Inkscape 0.92.3 (2405546, 2018-03-11), Windows 7 SP1
Edited by Nathan Lee