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
  • !374

Gradient stops should be able to handle percent values

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Catherine Holloway requested to merge milankie/extensions:milankie-master-patch-50453 into master Nov 25, 2021
  • Overview 8
  • Commits 4
  • Pipelines 6
  • Changes 5

According to https://www.w3.org/TR/SVG11/pservers.html#StopElementOffsetAttribute, gradient offsets can be either number or a percentage. However, when extracting a stop with percentage valued offsets, I get the stack trace:

gradient_to_path.py:50: in recursive_replace_gradient 
stops = gradient.stops                                                                                                                                                                                                                 
/usr/share/inkscape/extensions/inkex/elements/_filters.py:137: in stops                                                                                                                                                                          
return sorted([child for child in gradcolor if isinstance(child, Stop)]
     , key=lambda x: float(x.offset))
E   ValueError: could not convert string to float: '0%'
/usr/share/inkscape/extensions/inkex/elements/_filters.py:138: ValueError   
Edited Nov 25, 2021 by Catherine Holloway
Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: milankie-master-patch-50453