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

[feature request] Elliptical Radial Gradient #4276

Closed
ncou opened this issue Aug 31, 2017 · 4 comments
Closed

[feature request] Elliptical Radial Gradient #4276

ncou opened this issue Aug 31, 2017 · 4 comments

Comments

@ncou
Copy link
Collaborator

ncou commented Aug 31, 2017

Do you think it's possible to add a feature to do an elleptical radial gradient ?
For the moment the radial is only circular.

PS : I tried to use the scaleX or scaleY function but without success.

Thank you.

@asturur
Copy link
Member

asturur commented Sep 1, 2017

the onl way to get it is using a gradientTransform property on the gradient that will scale one direction.

gradientTransform = [1, 0, 0, 2, 0, 0] for example

@ncou
Copy link
Collaborator Author

ncou commented Sep 1, 2017

Thank you.
I encounter a strange behaviors => I could make the gradientTransform work when i set the gradiant using "setGradient()" on a rect, but i create a new object calling directly the gradient object, i could not make it work.
I checked in the constructor (initialize function) and it should take my matrix.

Here is my fiddle :
http://jsfiddle.net/tmchz9h0/17/
TEST 1 is ok (if you uncomment the line 61, the rect with the transformed radial is applied).
TEST 2 is ko if i use a setbackgroundcolor with the new fabric.Gradient object created.

I even tried something like : grad.gradientTransform = fabric.parseTransformAttribute([1,0,0,2,1,1]); after creating my Gradient object. but without success.

@asturur
Copy link
Member

asturur commented Sep 1, 2017

This fits with the other issue, the one that the gradients do not have a support for canvas.

@asturur
Copy link
Member

asturur commented Sep 1, 2017

duplicate of #4232

@asturur asturur closed this as completed Sep 1, 2017
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

No branches or pull requests

2 participants