void set_range (double lower, double upper);
void set_font_description (Pango::FontDescription);
-
+
void render (Rect const & area, Cairo::RefPtr<Cairo::Context>) const;
private:
- const Metric& _metric;
+ const Metric* _metric;
/* lower and upper and sample positions, which are also canvas coordinates
*/
Ruler::Ruler (Canvas* c, const Metric& m)
: Rectangle (c)
- , _metric (m)
+ , _metric (&m)
, _lower (0)
, _upper (0)
, _need_marks (true)
Ruler::Ruler (Canvas* c, const Metric& m, Rect const& r)
: Rectangle (c, r)
- , _metric (m)
+ , _metric (&m)
, _lower (0)
, _upper (0)
, _need_marks (true)
Ruler::Ruler (Item* parent, const Metric& m)
: Rectangle (parent)
- , _metric (m)
+ , _metric (&m)
, _lower (0)
, _upper (0)
, _need_marks (true)
Ruler::Ruler (Item* parent, const Metric& m, Rect const& r)
: Rectangle (parent, r)
- , _metric (m)
+ , _metric (&m)
, _lower (0)
, _upper (0)
, _need_marks (true)
if (_need_marks) {
marks.clear ();
- _metric.get_marks (marks, _lower, _upper, 50);
+ _metric->get_marks (marks, _lower, _upper, 50);
_need_marks = false;
}
for (vector<Mark>::const_iterator m = marks.begin(); m != marks.end(); ++m) {
Duple pos;
- pos.x = floor ((m->position - _lower) / _metric.units_per_pixel);
+ pos.x = floor ((m->position - _lower) / _metric->units_per_pixel);
pos.y = self.y1; /* bottom edge */
if (_outline_width == 1.0) {