Clear up some bugginess with the rubber-band box in single-select mode

git-svn-id: http://svg-edit.googlecode.com/svn/trunk@237 eee81c28-f429-11dd-99c0-75d572ba1ddd
master
Jeff Schiller 2009-06-30 16:12:08 +00:00
parent 097649b330
commit 6d8ab5888a
1 changed files with 12 additions and 9 deletions

View File

@ -586,22 +586,25 @@ function SvgCanvas(c)
// call this function with null to clear the selected element
var selectElement = function(newSelected, multi)
{
// if the element to be selected is actually the rubber-band box
// then simply return (do not select it)
if (newSelected == selectorManager.getRubberBandBox()) {
return;
}
// if we are not in multi-mode and newSelected is already selected
// then simply return
// otherwise clear all previous selectors
var multi = multi || false;
for (var i = 0; i < selectedElements.length; ++i) {
if (selectedElements[i] == newSelected) {
if (!multi) {
var selected = selectedElements[0];
if (selectedElements[0] == newSelected) {
return;
}
}
// this element is not in the selectedElements array
// if we're not in multi-mode, then clear the previous selector
var selected = selectedElements[0];
if (!multi && selected) {
selectorManager.releaseSelector(selected);
for (var i = 0; i < selectedElements.length; ++i) {
selectorManager.releaseSelector(selectedElements[i]);
}
}
selectedElements[0] = newSelected;