Better behavior for custom resolutions

git-svn-id: http://svg-edit.googlecode.com/svn/trunk@639 eee81c28-f429-11dd-99c0-75d572ba1ddd
master
Jeff Schiller 2009-09-14 01:17:29 +00:00
parent 78a77cf9d4
commit 11c49d61dd
2 changed files with 7 additions and 3 deletions

View File

@ -295,8 +295,7 @@
<button id="tool_docprops_cancel">Cancel</button>
<div id="change_resolution">
<label>Resolution:</label>
<select id="resolution">
<select id="resolution" label="Resolution:">
<option selected="selected">640x480</option>
<option>800x600</option>
<option>1024x768</option>

View File

@ -997,7 +997,12 @@ function svg_edit_setup() {
alert('Invalid size. Width or height may not be 0.');
return false;
}
$('#resolution').val(x+'x'+y);
var newOption = [x,'x',y].join('');
$("#resolution").val(newOption).attr("selected", "selected");
if ($("#resolution").val() != newOption) {
$('#resolution').append('<option>'+newOption+'</option>');
$("#resolution").val(newOption).attr("selected", "selected");
}
}
}
// svgCanvas.setResolution(x,y);