resize drawing area
git-svn-id: http://svg-edit.googlecode.com/svn/trunk@199 eee81c28-f429-11dd-99c0-75d572ba1dddmaster
parent
d955ca51d1
commit
1f5fca2fd6
|
@ -119,11 +119,11 @@
|
|||
}
|
||||
|
||||
#svg_editor #text_panel .text_tool {
|
||||
vertical-align:12px;
|
||||
vertical-align: 12px;
|
||||
}
|
||||
|
||||
#svg_editor #rect_panel .rect_tool {
|
||||
vertical-align:12px;
|
||||
vertical-align: 12px;
|
||||
}
|
||||
|
||||
#svg_editor #circle_panel .circle_tool {
|
||||
|
@ -224,5 +224,12 @@
|
|||
#svg_editor #footer {
|
||||
width: 705px;
|
||||
border-top: none;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
#svg_editor #footer_left {
|
||||
float: left;
|
||||
}
|
||||
|
||||
#svg_editor #footer_right {
|
||||
float: right;
|
||||
}
|
||||
|
|
|
@ -229,8 +229,16 @@
|
|||
</div>
|
||||
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
|
|
@ -497,5 +497,17 @@ function svg_edit_setup() {
|
|||
$('#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;
|
||||
};
|
||||
|
|
|
@ -94,6 +94,7 @@ function MoveElementCommand(elem, oldNextSibling, oldParent, text) {
|
|||
function SvgCanvas(c)
|
||||
{
|
||||
|
||||
|
||||
// private members
|
||||
var canvas = this;
|
||||
var container = c;
|
||||
|
@ -165,8 +166,8 @@ function SvgCanvas(c)
|
|||
|
||||
// private functions
|
||||
var getId = function() {
|
||||
if (events["getid"]) return call("getid",obj_num);
|
||||
return idprefix+obj_num;
|
||||
if (events["getid"]) return call("getid", obj_num);
|
||||
return idprefix + obj_num;
|
||||
}
|
||||
|
||||
var call = function(event, arg) {
|
||||
|
@ -903,6 +904,11 @@ function SvgCanvas(c)
|
|||
call("cleared");
|
||||
}
|
||||
|
||||
this.setResolution = function(x, y) {
|
||||
svgroot.setAttribute("width", x);
|
||||
svgroot.setAttribute("height", y);
|
||||
}
|
||||
|
||||
this.getMode = function() {
|
||||
return current_mode;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue