Skip to content

Instantly share code, notes, and snippets.

@pixelhijack
Created March 19, 2014 08:58
Show Gist options
  • Save pixelhijack/9637971 to your computer and use it in GitHub Desktop.
Save pixelhijack/9637971 to your computer and use it in GitHub Desktop.
/*
export whole canvas as JSON via RaphaelJSON
*/
exportJSON:function(){
var _this = this,
json = this.paper.toJSON(function(el, data){
data.ft = {};
if ( el.freeTransform != null ){
data.ft.attrs = el.freeTransform.attrs;
_this.paper.freeTransform(el).unplug();
};
return data;
});
if(this.output && typeof this.output == 'function'){
this.output.call(this, json);
};
}
/* ... */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment