13
0

slight optimization of PolyItem::render_path()

This commit is contained in:
Paul Davis 2013-12-28 13:52:08 -05:00
parent 218a4664be
commit a585816f3e

View File

@ -66,16 +66,15 @@ PolyItem::compute_bounding_box () const
void void
PolyItem::render_path (Rect const & /*area*/, Cairo::RefPtr<Cairo::Context> context) const PolyItem::render_path (Rect const & /*area*/, Cairo::RefPtr<Cairo::Context> context) const
{ {
bool done_first = false; Points::const_iterator i = _points.begin();
for (Points::const_iterator i = _points.begin(); i != _points.end(); ++i) { Duple c (item_to_window (Duple (i->x, i->y)));
if (done_first) {
Duple c = item_to_window (Duple (i->x, i->y)); context->move_to (c.x, c.y);
context->line_to (c.x, c.y);
} else { while (i != _points.end()) {
Duple c = item_to_window (Duple (i->x, i->y)); c = item_to_window (Duple (i->x, i->y));
context->move_to (c.x, c.y); context->line_to (c.x, c.y);
done_first = true; ++i;
}
} }
} }