Fixed issue 109: Arrow cursors are properly updated when rotating element

git-svn-id: http://svg-edit.googlecode.com/svn/trunk@473 eee81c28-f429-11dd-99c0-75d572ba1ddd
master
Alexis Deveria 2009-08-26 13:59:25 +00:00
parent 5eb2087f86
commit 328261b9e3
1 changed files with 23 additions and 5 deletions

View File

@ -220,11 +220,11 @@ function SvgCanvas(c)
this.selectorGrips = { "nw":null,
"n":null,
"ne":null,
"w":null,
"e":null,
"sw":null,
"se":null,
"s":null,
"se":null
"sw":null,
"w":null
};
// add the corner grips
@ -260,6 +260,24 @@ function SvgCanvas(c)
}
};
// Updates cursors for corner grips on rotation so arrows point the right way
this.updateGripCursors = function(angle) {
var dir_arr = [];
var steps = Math.round(angle / 45);
for (dir in this.selectorGrips) {
dir_arr.push(dir);
}
while(steps > 0) {
dir_arr.push(dir_arr.shift());
steps--;
}
var i = 0;
for (dir in this.selectorGrips) {
this.selectorGrips[dir].setAttribute('style', ("cursor:" + dir_arr[i] + "-resize"));
i++;
};
};
this.resize = function(cur_bbox) {
var selectedBox = this.selectorRect;
var selectedGrips = this.selectorGrips;
@ -2376,7 +2394,7 @@ function SvgCanvas(c)
if(pointGripContainer) {
pointGripContainer.setAttribute("transform", rotate);
}
selectorManager.requestSelector(selectedElements[0]).updateGripCursors(val);
};
this.each = function(cb) {