Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
  • Sign in / Register
  • extensions extensions
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 77
    • Issues 77
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 15
    • Merge requests 15
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Inkscape
  • extensionsextensions
  • Merge requests
  • !438

fix path reversal, computation of path proxy, end points and control points for multiple subpaths

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Jonathan Neuhauser requested to merge joneuhauser/extensions:fix-multiple-subsegments into master Feb 21, 2022
  • Overview 0
  • Commits 1
  • Pipelines 2
  • Changes 4

What does the merge request do?

Closes #450 (closed)

The path computation methods for paths with multiple subpaths was wrong. A new zone is created with every Z/z and M/m command, and we need to remember that position as new "first" point of the path. Previously, the "first" point was only set at the beginning.

This affected path reversal, path proxy, end points and control points. For path.transform, it was fixed in !230 (merged) already.

New output of "Number nodes" on the example file in #450 (closed):

image

Implementation notes

I've added a rather extensive unit test. Some previous unit tests changed to visually identical output; I think the new behavior of the reverse function is more correct. If a line does the same as the following Z command (i.e. the Z command only closes, but doesn't draw anything), then only use the Z commando instead of adding an extra command.) This way the number of commands of the reversed path is identical to that of the original path.

Summary for release notes

Extensions that query properties of paths with multiple subpaths now get more correct results if that path uses relative path commands.

Checklist

  • Add unit tests (if applicable)
  • Changes to inkex/ are well documented
  • Clean merge request history
Edited Feb 21, 2022 by Jonathan Neuhauser
Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: fix-multiple-subsegments