Improve and fix behaviour when collapsing straight paths segments
Created by: Ede123
- Do not collapse straight path segments in paths that have intermediate markers (see #145 (closed)). The intermediate nodes might be unnecessary for the shape of the path, but their markers would be lost.
- Collapse subpaths of moveto
m
and linetol
commands if they have the same direction (before we only collapsed horizontal/verticalh
/v
lineto commands) - Attempt to collapse lineto
l
commands into a preceding movetom
command (these are then called "implicit lineto commands") - Preserve empty path segments if they have
stroke-linecap
set toround
orsquare
. They render no visible line but a tiny dot or square.