First part of Issue 103: rotate handle on the selector box, doesn't do anything yet

git-svn-id: http://svg-edit.googlecode.com/svn/trunk@476 eee81c28-f429-11dd-99c0-75d572ba1ddd
master
Jeff Schiller 2009-08-26 19:09:13 +00:00
parent c204dcf5b0
commit 23069bfbfd
1 changed files with 26 additions and 2 deletions

View File

@ -226,7 +226,25 @@ function SvgCanvas(c)
"sw":null,
"w":null
};
this.rotateGripConnector = this.selectorGroup.appendChild( addSvgElementFromJson({
"element": "line",
"attr": {
"id": ("selectorGrip_rotate_connector_" + this.id),
"stroke": "blue",
"stroke-width": "1",
}
}) );
this.rotateGrip = this.selectorGroup.appendChild( addSvgElementFromJson({
"element": "circle",
"attr": {
"id": ("selectorGrip_rotate_" + this.id),
"fill": "lime",
"r": 4,
"stroke": "blue",
"stroke-width": 2
}
}) );
// add the corner grips
for (dir in this.selectorGrips) {
this.selectorGrips[dir] = this.selectorGroup.appendChild(
@ -255,9 +273,12 @@ function SvgCanvas(c)
this.showGrips = function(show) {
// TODO: use suspendRedraw() here
var bShow = show ? "inline" : "none";
for (dir in this.selectorGrips) {
this.selectorGrips[dir].setAttribute("display", show ? "inline" : "none");
this.selectorGrips[dir].setAttribute("display", bShow);
}
this.rotateGrip.setAttribute("display", bShow);
this.rotateGripConnector.setAttribute("display", bShow);
};
// Updates cursors for corner grips on rotation so arrows point the right way
@ -316,6 +337,9 @@ function SvgCanvas(c)
});
});
assignAttributes(this.rotateGripConnector, { x1: l+w/2, y1: t-20, x2: l+w/2, y2: t });
assignAttributes(this.rotateGrip, { cx: l+w/2, cy: t-20 });
// empty out the transform attribute
this.selectorGroup.setAttribute("transform", "");
this.selectorGroup.removeAttribute("transform");