Fixed issue 356 and zoom dblclick action

git-svn-id: http://svg-edit.googlecode.com/svn/trunk@1073 eee81c28-f429-11dd-99c0-75d572ba1ddd
master
Alexis Deveria 2009-12-18 21:30:56 +00:00
parent 35f1d7edf1
commit dd7f85c380
3 changed files with 9 additions and 2 deletions

View File

@ -411,7 +411,7 @@ script type="text/javascript" src="locale/locale.min.js"></script-->
<option id="lang_nl" value="nl">Nederlands</option>
<option id="lang_en" value="en" selected="selected">English</option>
<option id="lang_fr" value="fr">Français</option>
<option id="lang_de" value="de">Deutsch</option>
<!-- <option id="lang_de" value="de">Deutsch</option> -->
<option id="lang_ro" value="ro">Româneşte</option>
<option id="lang_sk" value="sk">Slovenčina</option>
</select>

View File

@ -2024,7 +2024,7 @@ function svg_edit_setup() {
{sel:'#tool_path', fn: clickPath, evt: 'click', key: 6},
{sel:'#tool_text', fn: clickText, evt: 'click', key: 7},
{sel:'#tool_image', fn: clickImage, evt: 'mouseup', key: 8},
{sel:'#tool_zoom', fn: clickZoom, evt: 'mouseup', dblclick: dblclickZoom, key: 9},
{sel:'#tool_zoom', fn: clickZoom, evt: 'mouseup', key: 9},
{sel:'#tool_clear', fn: clickClear, evt: 'click', key: [modKey+'N', true]},
{sel:'#tool_save', fn: function() { editingsource?saveSourceEditor():clickSave()}, evt: 'click', key: [modKey+'S', true]},
{sel:'#tool_open', fn: clickOpen, evt: 'click', key: [modKey+'O', true]},
@ -2110,11 +2110,15 @@ function svg_edit_setup() {
}
}
});
// Misc additional actions
// Make "return" keypress trigger the change event
$('.attr_changer, #image_url').bind('keydown', {combi:'return'},
function(evt) {$(this).change();evt.preventDefault();}
);
$('#tool_zoom').dblclick(dblclickZoom);
},
setTitles: function() {
$.each(key_assocs, function(keyval, sel) {

View File

@ -1091,6 +1091,7 @@ function BatchCommand(text) {
}
var svgCanvasToString = function() {
// TODO: Find out why Webkit throws an error somewhere here (breaking the editor)
removeUnusedGrads();
canvas.clearPath(true);
$.each(svgcontent.childNodes, function(i, node) {
@ -1104,6 +1105,8 @@ function BatchCommand(text) {
svgcontent.removeAttribute('viewBox');
var output = svgToString(svgcontent, 0);
assignAttributes(svgcontent, {id: 'svgcontent', 'viewBox':[0,0,res.w,res.h].join(' ')});
svgcontent.removeAttribute('width');
svgcontent.removeAttribute('height');
return output;
}