+ Vector tp1, tp2;
+ switch(triangle.dir & AATriangle::DEFORM_MASK) {
+ case 0:
+ tp1 = triangle.p1;
+ tp2 = triangle.p2;
+ break;
+ case AATriangle::DEFORM1:
+ tp1 = Vector(triangle.p1.x, triangle.p1.y + triangle.get_height()/2);
+ tp2 = triangle.p2;
+ break;
+ case AATriangle::DEFORM2:
+ tp1 = triangle.p1;
+ tp2 = Vector(triangle.p2.x, triangle.p1.y + triangle.get_height()/2);
+ break;
+ case AATriangle::DEFORM3:
+ tp1 = triangle.p1;
+ tp2 = Vector(triangle.p1.x + triangle.get_width()/2, triangle.p2.y);
+ break;
+ case AATriangle::DEFORM4:
+ tp1 = Vector(triangle.p1.x + triangle.get_width()/2, triangle.p1.y);
+ tp2 = triangle.p2;
+ break;
+ default:
+ assert(false);
+ }
+
+ switch(triangle.dir & AATriangle::DIRECTION_MASK) {