Added keyboard shortcut option for extension buttons, made import of connectors work, fixed issue 442

git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1286 eee81c28-f429-11dd-99c0-75d572ba1ddd
This commit is contained in:
Alexis Deveria
2010-01-27 21:03:43 +00:00
parent ee393cd933
commit 363eef5d57
4 changed files with 45 additions and 4 deletions

View File

@@ -78,7 +78,8 @@ var isOpera = !!window.opera,
return $('<p/>').html(str).text();
};
var unit_types = {'em':0,'ex':0,'px':1,'cm':35.43307,'mm':3.543307,'in':90,'pt':1.25,'pc':15,'%':0};
// These command objects are used for the Undo/Redo stack
// attrs contains the values that the attributes had before the change
function ChangeElementCommand(elem, attrs, text) {
@@ -4432,6 +4433,7 @@ function BatchCommand(text) {
current_mode = "select";
removeAllPointGripsFromPath();
canvas.clearSelection();
pathActions.clear();
if(selPath) {
call("selected", [elem]);
canvas.addToSelection([elem], true);
@@ -7248,6 +7250,16 @@ function BatchCommand(text) {
rect.setAttribute('x',.1);
var crect = rect.cloneNode(false);
support.goodDecimals = (crect.getAttribute('x').indexOf(',') == -1);
// Get correct em/ex values
var rect = document.createElementNS(svgns,'rect');
rect.setAttribute('width',"1em");
rect.setAttribute('height',"1ex");
svgcontent.appendChild(rect);
var bb = rect.getBBox();
unit_types.em = bb.width;
unit_types.ex = bb.height;
svgcontent.removeChild(rect);
}());
}
// Static class for various utility functions