X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-core%2Ftrunk%2Fsrc%2Fsynfig%2Frenddesc.cpp;h=9a498b176d841640e2abe0d4465a57565ed573d2;hb=9459638ad6797b8139f1e9f0715c96076dbf0890;hp=b1b28326c349e1a60b139de0f0cc57b095f3a85f;hpb=cc54c38609ee9745ad678e5e9b9d7d2912be9c95;p=synfig.git diff --git a/synfig-core/trunk/src/synfig/renddesc.cpp b/synfig-core/trunk/src/synfig/renddesc.cpp index b1b2832..9a498b1 100644 --- a/synfig-core/trunk/src/synfig/renddesc.cpp +++ b/synfig-core/trunk/src/synfig/renddesc.cpp @@ -6,6 +6,7 @@ ** ** \legal ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley +** Copyright (c) 2008 Chris Moore ** ** This package is free software; you can redistribute it and/or ** modify it under the terms of the GNU General Public License as @@ -42,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 ======================================================= */ @@ -100,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]