struct Layer_Shape::Intersector
{
Rect aabb;
+
+ //! true iff aabb hasn't been initialised yet
bool initaabb;
int flags;
int dir = (y > cur_y)*1 + (-1)*(y < cur_y);
//check for context (if not line start a new segment)
- //if we're not in line mode (cover's 0 set case), or if directions are different (not valid for 0 direction)
+ //if we're not in line mode (covers 0 set case), or if directions are different (not valid for 0 direction)
if(prim != TYPE_LINE || (dir && segs.back().ydir != dir))
{
MonoSegment seg(dir,x,x,y,y);
cur_x = x;
cur_y = y;
- aabb.expand(x,y); //expand the entire things bounding box
+ aabb.expand(x,y); //expand the entire thing's bounding box
tangent[0] = x - cur_x;
tangent[1] = x - cur_y;
if(invert)
return Rect::full_plane();
- Rect bounds(edge_table->aabb+offset);
- bounds.expand(max((bounds.get_min()-bounds.get_max()).mag()*0.01,feather));
+ if (edge_table->initaabb)
+ return Rect::zero();
+ Rect bounds(edge_table->aabb+offset);
+ bounds.expand(max((bounds.get_min() - bounds.get_max()).mag()*0.01,
+ feather));
return bounds;
}