resize drawing area

git-svn-id: http://svg-edit.googlecode.com/svn/trunk@199 eee81c28-f429-11dd-99c0-75d572ba1ddd
master
Pavol Rusnak 2009-06-25 08:22:30 +00:00
parent d955ca51d1
commit 1f5fca2fd6
4 changed files with 38 additions and 5 deletions

View File

@ -119,11 +119,11 @@
} }
#svg_editor #text_panel .text_tool { #svg_editor #text_panel .text_tool {
vertical-align:12px; vertical-align: 12px;
} }
#svg_editor #rect_panel .rect_tool { #svg_editor #rect_panel .rect_tool {
vertical-align:12px; vertical-align: 12px;
} }
#svg_editor #circle_panel .circle_tool { #svg_editor #circle_panel .circle_tool {
@ -224,5 +224,12 @@
#svg_editor #footer { #svg_editor #footer {
width: 705px; width: 705px;
border-top: none; border-top: none;
text-align: right; }
#svg_editor #footer_left {
float: left;
}
#svg_editor #footer_right {
float: right;
} }

View File

@ -229,8 +229,16 @@
</div> </div>
<div id="footer" class="tools_panel"> <div id="footer" class="tools_panel">
<div id="footer_left">
<select id="resolution">
<option selected="selected">640x480</option>
<option>800x600</option>
<option>1024x768</option>
</select>
</div><div id ="footer_right">
SVG-edit v2.2-preAlpha @ <a href="http://svg-edit.googlecode.com/">http://svg-edit.googlecode.com/</a> SVG-edit v2.2-preAlpha @ <a href="http://svg-edit.googlecode.com/">http://svg-edit.googlecode.com/</a>
</div> </div>
</div>
</div> </div>

View File

@ -497,5 +497,17 @@ function svg_edit_setup() {
$('#tools_ellipse').show(); $('#tools_ellipse').show();
}); });
$('#resolution').change(function(){
var res = this.value.split('x');
var x = parseInt(res[0]), y = parseInt(res[1]);
svgCanvas.setResolution(x,y);
$('#svgroot').css( { 'width': x, 'height': y } );
$('#svgcanvas').css( { 'width': x, 'height': y } );
$('div#palette_holder').css('width', x);
$('#context_tools').css('width', x + 65);
$('#tools').css('height', y + 24);
$('#footer').css('width', x + 65);
});
return svgCanvas; return svgCanvas;
}; };

View File

@ -94,6 +94,7 @@ function MoveElementCommand(elem, oldNextSibling, oldParent, text) {
function SvgCanvas(c) function SvgCanvas(c)
{ {
// private members // private members
var canvas = this; var canvas = this;
var container = c; var container = c;
@ -165,8 +166,8 @@ function SvgCanvas(c)
// private functions // private functions
var getId = function() { var getId = function() {
if (events["getid"]) return call("getid",obj_num); if (events["getid"]) return call("getid", obj_num);
return idprefix+obj_num; return idprefix + obj_num;
} }
var call = function(event, arg) { var call = function(event, arg) {
@ -903,6 +904,11 @@ function SvgCanvas(c)
call("cleared"); call("cleared");
} }
this.setResolution = function(x, y) {
svgroot.setAttribute("width", x);
svgroot.setAttribute("height", y);
}
this.getMode = function() { this.getMode = function() {
return current_mode; return current_mode;
} }