Fixed bugs in Opera 10.10 and some Opera/Win/Non-EN bugs by reverting part of r838 and using our own transformlist implementation

git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1129 eee81c28-f429-11dd-99c0-75d572ba1ddd
master
Alexis Deveria 2009-12-30 20:12:13 +00:00
parent 0ed21291b9
commit 0beb2f19a2
2 changed files with 20 additions and 9 deletions

View File

@ -495,7 +495,6 @@ function svg_edit_setup() {
else { else {
$('#selLayerNames').attr('disabled', 'disabled'); $('#selLayerNames').attr('disabled', 'disabled');
} }
}; };
$('#text').focus( function(){ textBeingEntered = true; } ); $('#text').focus( function(){ textBeingEntered = true; } );
@ -1591,6 +1590,11 @@ function svg_edit_setup() {
$(button).removeClass('tool_button_disabled').addClass('tool_button'); $(button).removeClass('tool_button_disabled').addClass('tool_button');
} }
} }
if(window.opera) {
// Fix repaint bug for Opera
$('<p/>').hide().appendTo('body').remove();
}
}; };
// set up gradients to be used for the buttons // set up gradients to be used for the buttons

View File

@ -3028,21 +3028,26 @@ function BatchCommand(text) {
} }
break; break;
case "line": case "line":
keep = (element.x1.baseVal.value != element.x2.baseVal.value || // keep = (element.x1.baseVal.value != element.x2.baseVal.value ||
element.y1.baseVal.value != element.y2.baseVal.value); // element.y1.baseVal.value != element.y2.baseVal.value);
keep = (element.getAttribute('x1') != element.getAttribute('x2') || element.getAttribute('y1') != element.getAttribute('y2'));
break; break;
case "square": case "square":
case "rect": case "rect":
keep = (element.width.baseVal.value && element.height.baseVal.value); // keep = (element.width.baseVal.value && element.height.baseVal.value);
keep = (element.getAttribute('width') != 0 || element.getAttribute('height') != 0);
break; break;
case "image": case "image":
keep = (element.width.baseVal.value && element.height.baseVal.value); // keep = (element.width.baseVal.value && element.height.baseVal.value);
keep = (element.getAttribute('width') != 0 || element.getAttribute('height') != 0);
break; break;
case "circle": case "circle":
keep = (element.r.baseVal.value); // keep = (element.r.baseVal.value);
keep = (element.getAttribute('r') != 0);
break; break;
case "ellipse": case "ellipse":
keep = (element.rx.baseVal.value && element.ry.baseVal.value); // keep = (element.rx.baseVal.value && element.ry.baseVal.value);
keep = (element.getAttribute('rx') != null || element.getAttribute('ry') != null);
break; break;
case "fhellipse": case "fhellipse":
if ((freehand.maxx - freehand.minx) > 0 && if ((freehand.maxx - freehand.minx) > 0 &&
@ -5579,7 +5584,9 @@ function BatchCommand(text) {
// returns an object that behaves like a SVGTransformList // returns an object that behaves like a SVGTransformList
this.getTransformList = function(elem) { this.getTransformList = function(elem) {
if (isWebkit) { // Opera is included here because Opera/Win/Non-EN seems to change
// transformlist float vals to use a comma rather than a period.
if (isWebkit || isOpera) {
var t = svgTransformLists[elem.id]; var t = svgTransformLists[elem.id];
if (!t) { if (!t) {
svgTransformLists[elem.id] = new SVGEditTransformList(elem); svgTransformLists[elem.id] = new SVGEditTransformList(elem);
@ -5662,13 +5669,13 @@ function BatchCommand(text) {
tlist.removeItem(0); tlist.removeItem(0);
} }
} }
// find R_nc and insert it // find R_nc and insert it
if (val != 0) { if (val != 0) {
var center = transformPoint(cx,cy,transformListToTransform(tlist).matrix); var center = transformPoint(cx,cy,transformListToTransform(tlist).matrix);
var R_nc = svgroot.createSVGTransform(); var R_nc = svgroot.createSVGTransform();
R_nc.setRotate(val, center.x, center.y); R_nc.setRotate(val, center.x, center.y);
tlist.insertItemBefore(R_nc,0); tlist.insertItemBefore(R_nc,0);
opera.postError(elem.getAttribute("transform"))
} }
else if (tlist.numberOfItems == 0) { else if (tlist.numberOfItems == 0) {
elem.removeAttribute("transform"); elem.removeAttribute("transform");