Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gunshi patch 1 #11

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Conversation

gunshi
Copy link

@gunshi gunshi commented Feb 15, 2015

path
inverse

Relative to absolute function called 'toabs()' takes in Arc (A) commands also.
An inverse function has been added, which creates a complement of the path element given as input, and along with function tostr() and complete() creates a string format complement of the path element which can be put in as the value of the 'd' attribute.
The images show what the complement looks like, and is a way to do what could probably also be done by masks, but masks don't work with all browsers.

Function to convert relative commands to absolute commands, including the A(arcto) command, this function is needed to support another function to be added, which, given a path element, outputs its inverse path element, which is something i had to generate when i was working on a particular application using clipping paths.
during work on a recent project, i had to create the inverse of a path element, so that i could use it as a clipping path on another overlapping element, therefore removing the overlap.(this is needed because there are a lot of irregularities if you trace an svg through Inkscape without enabling the stack scans option)
through experimentation i realised that this can be done with drawing the same path in reverse order, and drawing a frame of the same dimensions as the image along with it, which causes the area of the image excluding that path element to be filled instead.
Where the frame is being added, scalex and scaley is the absolute scaling in the x and y direction respectively.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant