From: dooglus Date: Wed, 26 Nov 2008 12:30:58 +0000 (+0000) Subject: Add further comments. Add local definition of FLAGS macro instead of using the one... X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=0dc833151455b153bde88988b4137b64216551c8;p=synfig.git Add further comments. Add local definition of FLAGS macro instead of using the one from color.h. Remove unused flag checking code. git-svn-id: https://synfig.svn.sourceforge.net/svnroot/synfig@2280 1f10aa63-cdf2-0310-b900-c93c546f37ac --- diff --git a/synfig-core/trunk/src/synfig/renddesc.cpp b/synfig-core/trunk/src/synfig/renddesc.cpp index cc3882c..9a498b1 100644 --- a/synfig-core/trunk/src/synfig/renddesc.cpp +++ b/synfig-core/trunk/src/synfig/renddesc.cpp @@ -43,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 ======================================================= */ @@ -101,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](~(int)rhs); } -//! \todo This code isn't used - so how are flags checked? Using the FLAGS macro from color.h? -//! This operator is for checking RendDesc::Lock flags. -/*! Don't think of it as "less then or equal to", but think of it -** like an arrow. Is \a rhs inside of \a lhs ? -** \see RendDesc::Lock, RendDesc */ -// inline bool operator<=(RendDesc::Lock lhs, RendDesc::Lock rhs) -// { -// return (static_cast(lhs) & static_cast(rhs)) == static_cast(rhs); -// } - - }; /* end namespace synfig */ /* === E N D =============================================================== */