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 76
    • Issues 76
    • List
    • Boards
    • Service Desk
    • Milestones
    • Requirements
  • Merge requests 13
    • Merge requests 13
  • 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
  • InkscapeInkscape
  • extensionsextensions
  • Merge requests
  • !386

Refactor extrude extension

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Jonathan Neuhauser requested to merge joneuhauser/extensions:refactor-extrude into master Jan 12, 2022
  • Overview 11
  • Commits 12
  • Pipelines 6
  • Changes 19

Closes #190 (closed)

The extrude extension has been refactored and fixed; instead of using CubicSuperPath which is not necessary in this case, we use the PathCommandProxy.

The extension works on all objects that can be converted to path, paths with multiple subpaths etc, and respects the stacking order. Code coverage is 99% (the only missed line is the one which aborts the extension).

I also added a new mode that makes more sense than the "Rectangle" mode: demo

Breaking change: Previously, the generated group / path was added as last child of the first element's parent, I changed it so it is inserted in between the two elements (which is a bit more sensible)

This merge request also includes some fixes to the PathCommandProxy code - previously, the coordinate computation was plain wrong:

path = Path("M 10 10 h 10 v 10 h -10 Z")
proxycommands = list(Path.proxy_iterator())
print(list(proxycommands[2].previous_end_point))

resulted in [20,20] because the Move command was applied twice.

This wasn't discovered by the tests - the entire PathCommandProxy stuff was only covered implicitly by tests for path.reverse which only used relative (lowercase) commands, so it didn't matter. Fixing this then broke the reverse command for relative ZoneClose which only worked for the incorrect coordinate computation. I added a unit test for the coordinate computation, but in general more tests for PathCommandProxy would be nice.

Also there was a mistake in the path reversal for arcs - a sweep flag of 1 was reversed to a flag of -1 which is invalid syntax and should be 0. This wasn't tested for at all (but is now through the unit tests for this extension).

Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: refactor-extrude