More minor tweaks, still no multi-select

git-svn-id: http://svg-edit.googlecode.com/svn/trunk@233 eee81c28-f429-11dd-99c0-75d572ba1ddd
master
Jeff Schiller 2009-06-30 06:37:39 +00:00
parent afca995083
commit 1207de3e61
1 changed files with 9 additions and 3 deletions

View File

@ -221,8 +221,9 @@ function SvgCanvas(c)
};
};
// TODO: consider a map of SVG elements to their selectors in the manager for
// quick access to the selector in question (as opposed to looping through the array)
// TODO: add accessor methods to determine number of currently selected elements
// TODO: move selectElement into SelectorManager and allow multiple selected elements
// with each call
function SelectorManager() {
// this will hold the <g> element that contains all selector rects/grips
@ -233,6 +234,9 @@ function SvgCanvas(c)
// this will hold objects of type Selector (see above)
this.selectors = [];
// this holds a map of SVG elements to their Selector object
this.selectorMap = {};
// local reference to this object
var mgr = this;
@ -261,6 +265,7 @@ function SvgCanvas(c)
// if we reached here, no available selectors were found, we create one
this.selectors[N] = new Selector(N, elem);
this.selectorParentGroup.appendChild(this.selectors[N].selectorGroup);
this.selectorMap[elem] = this.selectors[N];
return this.selectors[N];
};
this.releaseSelector = function(sel) {
@ -270,6 +275,7 @@ function SvgCanvas(c)
if (sel.locked == false) {
console.log("WARNING! selector was released but was already unlocked");
}
delete this.selectorMap[sel.selectedElement];
sel.locked = false;
sel.selectedElement = null;
@ -606,7 +612,7 @@ function SvgCanvas(c)
}
// do not show resize grips on text elements
theSelector.showGrips(selected.tagName != "text");
theSelector.showGrips(selected.tagName != "text" && current_mode != "multiselect");
}
call("selected", selected);