+vector<Vec2> & Path::FillPoints(const Objects & objects, const View & view)
+{
+ if (m_fill_points.size() != 0)
+ return m_fill_points;
+
+
+ for (unsigned i = m_start; i <= m_end; ++i)
+ {
+ const Rect & objb = objects.bounds[i];
+ // find fill points
+ Vec2 pt;
+ // left
+ pt = Vec2(objb.x, objb.y+objb.h/Real(2));
+ if (PointInside(objects, pt))
+ m_fill_points.push_back(pt);
+ // right
+ pt = Vec2(objb.x+objb.w, objb.y+objb.h/Real(2));
+ if (PointInside(objects, pt))
+ m_fill_points.push_back(pt);
+ // bottom
+ pt = Vec2(objb.x+objb.w/Real(2), objb.y+objb.h);
+ if (PointInside(objects, pt))
+ m_fill_points.push_back(pt);
+ // top
+ pt = Vec2(objb.x+objb.w/Real(2), objb.y);
+ if (PointInside(objects, pt))
+ m_fill_points.push_back(pt);
+
+ // topleft
+ pt = Vec2(objb.x, objb.y);
+ if (PointInside(objects, pt))
+ m_fill_points.push_back(pt);
+ // topright
+ pt = Vec2(objb.x+objb.w, objb.y);
+ if (PointInside(objects, pt))
+ m_fill_points.push_back(pt);
+ // bottom left
+ pt = Vec2(objb.x, objb.y+objb.h);
+ if (PointInside(objects, pt))
+ m_fill_points.push_back(pt);
+ // bottom right
+ pt = Vec2(objb.x+objb.w, objb.y);
+ if (PointInside(objects, pt))
+ m_fill_points.push_back(pt);
+
+ // mid
+ pt = Vec2(objb.x+objb.w/Real(2), objb.y+objb.h/Real(2));
+ if (PointInside(objects, pt))
+ m_fill_points.push_back(pt);
+
+
+ }
+
+ // 4 extrema
+ Vec2 pt = (m_top + m_bottom)/2;
+ if (PointInside(objects, pt))
+ m_fill_points.push_back(pt);
+ pt = (m_left + m_right)/2;
+ if (PointInside(objects, pt))
+ m_fill_points.push_back(pt);
+ pt = (m_left + m_right + m_top + m_bottom)/4;
+ if (PointInside(objects, pt))
+ m_fill_points.push_back(pt);
+
+ return m_fill_points;
+}
+
+Rect Path::SolveBounds(const Objects & objects)
+{
+ return Rect(m_left.x, m_top.y, m_right.x-m_left.x, m_bottom.y-m_top.y);
+}
+
+Rect & Path::GetBounds(Objects & objects)