Migrate another few bits of code into path.js

git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1997 eee81c28-f429-11dd-99c0-75d572ba1ddd
This commit is contained in:
Jeff Schiller
2011-02-23 16:24:07 +00:00
parent 6d6c6aa61f
commit 34bc623f08
2 changed files with 26 additions and 15 deletions

View File

@@ -44,6 +44,10 @@ var pathFuncs = [];
var link_control_pts = true;
// Stores references to paths via IDs.
// TODO: Make this cross-document happy.
var pathData = {};
svgedit.path.setLinkControlPoints = function(lcp) {
link_control_pts = lcp;
};
@@ -875,4 +879,22 @@ svgedit.path.Path.prototype.update = function() {
return this;
};
// TODO: This creates
svgedit.path.getPath_ = function(elem) {
var p = pathData[elem.id];
if(!p) p = pathData[elem.id] = new svgedit.path.Path(elem);
return p;
};
svgedit.path.removePath_ = function(id) {
if(id in pathData) delete pathData[id];
};
// ====================================
// Public API starts here
svgedit.path.clearData = function() {
pathData = {};
};
})();