slight optimization of PolyItem::render_path()
This commit is contained in:
parent
218a4664be
commit
a585816f3e
|
@ -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;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user