Created
July 16, 2014 10:10
-
-
Save simonwoo/cc6e11ee851212e7b186 to your computer and use it in GitHub Desktop.
change the position of a path without changing its transform attribute
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function(){ | |
//create a paper | |
var paper = Raphael("paper", 500,500); | |
//create a line | |
var path = paper.path("M100,100L200,200").attr({fill: "orange"}); | |
//the identity matrix | |
var m = Raphael.matrix(1,0,0,1,0,0); | |
m.scale(2,1,100,100); | |
var pathString = Raphael.mapPath(path2.attr("path"),m); | |
var new = paper.path(newPath).attr({fill: "red"}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment