Layout::ConstraintType Layout::complement(ConstraintType type)
{
- if(type==RIGHT_OF)
- return LEFT_OF;
- else if(type==LEFT_OF)
- return RIGHT_OF;
- else if(type==ABOVE)
- return BELOW;
- else if(type==BELOW)
- return ABOVE;
- else
- return type;
+ return static_cast<ConstraintType>((type&~(SELF_MASK|TARGET_MASK)) | ((type&SELF_MASK)<<2) | ((type&TARGET_MASK)>>2));
}
void Layout::create_constraint(Widget &src, ConstraintType type, Widget &tgt, int sp)