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-75d572ba1dddmaster
parent
c204dcf5b0
commit
23069bfbfd
|
@ -226,6 +226,24 @@ function SvgCanvas(c)
|
||||||
"sw":null,
|
"sw":null,
|
||||||
"w":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
|
// add the corner grips
|
||||||
for (dir in this.selectorGrips) {
|
for (dir in this.selectorGrips) {
|
||||||
|
@ -255,9 +273,12 @@ function SvgCanvas(c)
|
||||||
|
|
||||||
this.showGrips = function(show) {
|
this.showGrips = function(show) {
|
||||||
// TODO: use suspendRedraw() here
|
// TODO: use suspendRedraw() here
|
||||||
|
var bShow = show ? "inline" : "none";
|
||||||
for (dir in this.selectorGrips) {
|
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
|
// 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
|
// empty out the transform attribute
|
||||||
this.selectorGroup.setAttribute("transform", "");
|
this.selectorGroup.setAttribute("transform", "");
|
||||||
this.selectorGroup.removeAttribute("transform");
|
this.selectorGroup.removeAttribute("transform");
|
||||||
|
|
Loading…
Reference in New Issue