src/basics.cpp

changeset 1305
31627acdd4b5
parent 1181
ca6d0ef9aadb
child 1308
dcc8c02530c2
equal deleted inserted replaced
1304:bb3f43293cf8 1305:31627acdd4b5
358 return point.y() - rectangle.bottom(); 358 return point.y() - rectangle.bottom();
359 else // IX 359 else // IX
360 return 0; 360 return 0;
361 } 361 }
362 } 362 }
363
364 /*
365 * Special operator definition that implements the XOR operator for windings.
366 * However, if either winding is NoWinding, then this function returns NoWinding.
367 */
368 Winding operator^(Winding one, Winding other)
369 {
370 if (one == NoWinding or other == NoWinding)
371 return NoWinding;
372 else
373 return static_cast<Winding>(static_cast<int>(one) ^ static_cast<int>(other));
374 }
375
376 Winding& operator^=(Winding& one, Winding other)
377 {
378 one = one ^ other;
379 return one;
380 }

mercurial