Fix the aspect ratio bug introduced by the previous commits of preferred X/Y new...
authorgenete <genete@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Thu, 11 Sep 2008 15:00:44 +0000 (15:00 +0000)
committergenete <genete@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Thu, 11 Sep 2008 15:00:44 +0000 (15:00 +0000)
git-svn-id: https://synfig.svn.sourceforge.net/svnroot/synfig@2046 1f10aa63-cdf2-0310-b900-c93c546f37ac

synfig-studio/trunk/src/gtkmm/app.cpp

index beb061d..8525e0a 100644 (file)
@@ -2398,8 +2398,10 @@ App::new_instance()
        canvas->rend_desc().set_time_end(5.0);
        canvas->rend_desc().set_x_res(DPI2DPM(72.0f));
        canvas->rend_desc().set_y_res(DPI2DPM(72.0f));
-       canvas->rend_desc().set_tl(Vector(-4,2.25));
-       canvas->rend_desc().set_br(Vector(4,-2.25));
+       // The top left and botton right positions are expressed in units
+       // Original convention is that 1 unit = 60 pixels
+       canvas->rend_desc().set_tl(Vector(-(preferred_x_size/60.0)/2.0,(preferred_y_size/60.0)/2.0));
+       canvas->rend_desc().set_br(Vector((preferred_x_size/60.0)/2.0,-(preferred_y_size/60.0)/2.0));
        canvas->rend_desc().set_w(preferred_x_size);
        canvas->rend_desc().set_h(preferred_y_size);
        canvas->rend_desc().set_antialias(1);