X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-core%2Ftrunk%2Fsrc%2Fsynfig%2Frenddesc.cpp;h=9a498b176d841640e2abe0d4465a57565ed573d2;hb=2ccf682bfdcdf0ac006e454942f90399fde01312;hp=94dc16d18587f4c93adad07fe520bd2211031ce8;hpb=28f28705612902c15cd0702cc891fba35bf2d2df;p=synfig.git diff --git a/synfig-core/trunk/src/synfig/renddesc.cpp b/synfig-core/trunk/src/synfig/renddesc.cpp index 94dc16d..9a498b1 100644 --- a/synfig-core/trunk/src/synfig/renddesc.cpp +++ b/synfig-core/trunk/src/synfig/renddesc.cpp @@ -1,20 +1,22 @@ /* === S Y N F I G ========================================================= */ -/*! \file renddesc.h_ +/*! \file synfig/renddesc.cpp ** \brief RendDesc ** -** $Id: renddesc.cpp,v 1.1.1.1 2005/01/04 01:23:14 darco Exp $ +** $Id$ ** ** \legal -** Copyright (c) 2002 Robert B. Quattlebaum Jr. +** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley +** Copyright (c) 2008 Chris Moore ** -** This software and associated documentation -** are CONFIDENTIAL and PROPRIETARY property of -** the above-mentioned copyright holder. +** This package is free software; you can redistribute it and/or +** modify it under the terms of the GNU General Public License as +** published by the Free Software Foundation; either version 2 of +** the License, or (at your option) any later version. ** -** You may not copy, print, publish, or in any -** other way distribute this software without -** a prior written agreement with -** the copyright holder. +** This package is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +** General Public License for more details. ** \endlegal */ /* ========================================================================= */ @@ -41,6 +43,9 @@ using namespace synfig; /* === M A C R O S ========================================================= */ +#undef FLAGS +#define FLAGS(x,y) (((x)&(y))==(y)) + /* === G L O B A L S ======================================================= */ /* === M E T H O D S ======================================================= */ @@ -99,25 +104,25 @@ RendDesc::get_w()const RendDesc & RendDesc::set_w(int x) { - if(FLAGS(flags,LINK_PX_ASPECT)) + if(FLAGS(flags,LINK_PX_ASPECT)) // never set { h_=h_*x/w_; w_=x; } - else if(FLAGS(flags,LINK_PX_AREA)) + else if(FLAGS(flags,LINK_PX_AREA)) // never set { //! \writeme w_=x; } - else if(FLAGS(flags,PX_ASPECT)) + else if(FLAGS(flags,PX_ASPECT)) // "Pixel Aspect" { Vector d=br_-tl_; float old_span=get_span(); // If we should preserve image width - if( FLAGS(flags,IM_W) - || (FLAGS(flags,IM_ZOOMIN) && d[1]>d[1]/x*w_) - || (FLAGS(flags,IM_ZOOMOUT) && d[1]d[1]/x*w_) // never set + || (FLAGS(flags,IM_ZOOMOUT) && d[1]d[0]/y*h_) - || (FLAGS(flags,IM_ZOOMOUT) && d[0]d[0]/y*h_) // never set + || (FLAGS(flags,IM_ZOOMOUT) && d[0]