Undo work on Issue 336: Live Updates to Dimensions
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1944 eee81c28-f429-11dd-99c0-75d572ba1ddd
This commit is contained in:
@@ -711,7 +711,6 @@
|
|||||||
if(!elem) return;
|
if(!elem) return;
|
||||||
|
|
||||||
multiselected = (elems.length >= 2 && elems[1] != null);
|
multiselected = (elems.length >= 2 && elems[1] != null);
|
||||||
|
|
||||||
// Only updating fields for single elements for now
|
// Only updating fields for single elements for now
|
||||||
if(!multiselected) {
|
if(!multiselected) {
|
||||||
switch ( mode ) {
|
switch ( mode ) {
|
||||||
@@ -721,9 +720,10 @@
|
|||||||
$('#tool_reorient').toggleClass('disabled', ang == 0);
|
$('#tool_reorient').toggleClass('disabled', ang == 0);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "select":
|
// TODO: Update values that change on move/resize, etc
|
||||||
updateCoords(elem);
|
// case "select":
|
||||||
break;
|
// case "resize":
|
||||||
|
// break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
svgCanvas.runExtensions("elementTransition", {
|
svgCanvas.runExtensions("elementTransition", {
|
||||||
@@ -1375,38 +1375,6 @@
|
|||||||
return new $.jGraduate.Paint(opts);
|
return new $.jGraduate.Paint(opts);
|
||||||
};
|
};
|
||||||
|
|
||||||
// Updates coordinate data of given elements. Could use optimization!
|
|
||||||
var updateCoords = function(elem) {
|
|
||||||
var elname = elem.tagName;
|
|
||||||
var unit = curConfig.baseUnit !== 'px' ? curConfig.baseUnit : null;
|
|
||||||
var x, y;
|
|
||||||
|
|
||||||
// Get BBox vals for g, polyline and path
|
|
||||||
if(['g', 'polyline', 'path'].indexOf(elname) >= 0) {
|
|
||||||
var bb = svgCanvas.getStrokedBBox([elem]);
|
|
||||||
if(bb) {
|
|
||||||
x = bb.x;
|
|
||||||
y = bb.y;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
x = elem.getAttribute('x');
|
|
||||||
y = elem.getAttribute('y');
|
|
||||||
}
|
|
||||||
|
|
||||||
// Transform point
|
|
||||||
var newPt = svgedit.math.transformPoint(x, y, svgCanvas.transformListToTransform(svgCanvas.getTransformList(elem)).matrix);
|
|
||||||
|
|
||||||
x = newPt.x;
|
|
||||||
y = newPt.y;
|
|
||||||
|
|
||||||
if(unit) {
|
|
||||||
x = svgCanvas.convertUnit(x);
|
|
||||||
y = svgCanvas.convertUnit(y);
|
|
||||||
}
|
|
||||||
$('#selected_x').val(x || 0);
|
|
||||||
$('#selected_y').val(y || 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// updates the toolbar (colors, opacity, etc) based on the selected element
|
// updates the toolbar (colors, opacity, etc) based on the selected element
|
||||||
// This function also updates the opacity and id elements that are in the context panel
|
// This function also updates the opacity and id elements that are in the context panel
|
||||||
|
|||||||
Reference in New Issue
Block a user