This can be noted using only the functions of the raphael library.
When applying the scaling function to the raphael object, a new svg node is created with coordinate scaling, but, unfortunately, it does not change the fill properties
In any case, when you add the attribute "fill" with url, the library creates a template. If this is the first βfillβ attribute you use, this pattern is called raphael-pattern-0 , the next is called raphael-pattern-1 , etc.)
Knowing this, then you can change the template attribute in accordance with the SVG specifications
You can get the template attributes using document.getElementById("raphael-pattern-0") and change its properties using setAttribute For example (depending on what you really want to do), it could be something like:
var pat = document.getElementById("raphael-pattern-0"); pat.setAttribute("height", pat.getAttribute("height")*0.5); pat.setAttribute("width", pat.getAttribute("width")*0.5);
You can also change the x , y , patternUnits and patternContentUnits .
I hope he answers your question.
Thibhib
source share