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

Implemented linear and radial gradients for fill and stroke colors. #93

Open
wants to merge 1 commit into
base: gh-pages
Choose a base branch
from

Conversation

winsock
Copy link

@winsock winsock commented Nov 1, 2017

I have not tested this extensively. It was a quick hack of the code so I didn't have to manually import all of the SVGs with gradients into Android Studio. For the 41 SVGs I tested it with it worked properly.
One outstanding issue is that I didn't bother with making sure indentation worked properly.

@yuraj11
Copy link
Collaborator

yuraj11 commented Nov 6, 2017

It looks OK but It does not work correctly on this - could you please check It?
Also when I try to build the project It shows me error:

Error while processing C:\Users\Yuraj\Repos\Experiments2\app\src\main\res\drawable\aa.xml : Start point cannot equalendpoint

problematic_drawing.zip

@yuraj11
Copy link
Collaborator

yuraj11 commented Feb 23, 2018

@winsock Could you please check my SVG and try convert with your changes? Because It does not correctly generates <gradient block

@ddobrev
Copy link

ddobrev commented May 31, 2018

@winsock thank you for your work. Could you please finish it?
@yuraj11 in case @winsock is unable to continue, could you please finish his work? This feature is really important.

@winsock
Copy link
Author

winsock commented May 31, 2018

@yuraj11 @ddobrev I apologize for the really late response for addressing these issues. I have been slammed at work with a project leaving almost no free time.

Your test SVG now renders properly. Apparently there were a couple of issues, substituteUseRef wasn't copying children and Inkscape was using style attributes for stop-color and opacity unlike Adobe Illustrator setting those as their own attributes.

Fixed radial gradients.

Enable transforms for gradients.

Radial transforms not fully supported. Not sure how to deal with scale for them.

Parse the transforms as floats

Update main.js

Fix item tag generation and substituteUseRef

This should be a return

Parse the style attribute on the stop tag.

Adobe likes making stop-color and stop-opacity attributes. Looks like Inkscape use stye tags.

Typo with an extra parentheses

Fix the extra tag close

Bump version number

So it doesn't load an old version from the browser cache.
@winsock
Copy link
Author

winsock commented May 31, 2018

Just rebased and squashed as well to make this merge cleaner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants