From 237339c3146f0d1039a941561ad316ce8df11856 Mon Sep 17 00:00:00 2001 From: dooglus Date: Fri, 7 Mar 2008 23:26:58 +0000 Subject: [PATCH] If only one of -w and -h is specified on the command line, calculate the other in order to keep the aspect ratio fixed. git-svn-id: http://svn.voria.com/code@1877 1f10aa63-cdf2-0310-b900-c93c546f37ac --- synfig-core/trunk/src/tool/main.cpp | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/synfig-core/trunk/src/tool/main.cpp b/synfig-core/trunk/src/tool/main.cpp index 77281c8..1862f4b 100644 --- a/synfig-core/trunk/src/tool/main.cpp +++ b/synfig-core/trunk/src/tool/main.cpp @@ -682,24 +682,16 @@ int extract_RendDesc(arg_list_t &arg_list,RendDesc &desc) else if (flag_requires_value(*iter)) iter=next++; } - if(w&&h) + if (w||h) { + if (!w) + w = desc.get_w() * h / desc.get_h(); + else if (!h) + h = desc.get_h() * w / desc.get_w(); + desc.set_wh(w,h); VERBOSE_OUT(1)<