Skip to content

Instantly share code, notes, and snippets.

@simonwoo
Created July 16, 2014 10:10
Show Gist options
  • Save simonwoo/cc6e11ee851212e7b186 to your computer and use it in GitHub Desktop.
Save simonwoo/cc6e11ee851212e7b186 to your computer and use it in GitHub Desktop.
change the position of a path without changing its transform attribute
$(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