- const ViewItemPaintParams pp(rect(), view_.scale(), view_.offset());
-
- for (const shared_ptr<TimeItem> t : time_items)
- t->paint_back(p, pp);
- for (const shared_ptr<RowItem> r : row_items)
- r->paint_back(p, pp);
-
- for (const shared_ptr<TimeItem> t : time_items)
- t->paint_mid(p, pp);
- for (const shared_ptr<RowItem> r : row_items)
- r->paint_mid(p, pp);
-
- for (const shared_ptr<RowItem> r : row_items)
- r->paint_fore(p, pp);
+ for (LayerPaintFunc *paint_func = layer_paint_funcs;
+ *paint_func; paint_func++) {
+ ViewItemPaintParams time_pp(rect(), view_.scale(), view_.offset());
+ for (const shared_ptr<TimeItem> t : time_items)
+ (t.get()->*(*paint_func))(p, time_pp);