From 94adde7ebb915b36c2507e5da1bd38884167eddc Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Fri, 5 Sep 2014 14:45:27 -0400 Subject: [PATCH] add Canvas::Ruler::set_metric() to allow ruler metrics to be changed dynamically --- libs/canvas/canvas/ruler.h | 1 + libs/canvas/ruler.cc | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/libs/canvas/canvas/ruler.h b/libs/canvas/canvas/ruler.h index 995b311e64..56876e761b 100644 --- a/libs/canvas/canvas/ruler.h +++ b/libs/canvas/canvas/ruler.h @@ -62,6 +62,7 @@ public: void set_range (double lower, double upper); void set_font_description (Pango::FontDescription); + void set_metric (const Metric&); void render (Rect const & area, Cairo::RefPtr) const; diff --git a/libs/canvas/ruler.cc b/libs/canvas/ruler.cc index 907fc93e99..b11793cb7f 100644 --- a/libs/canvas/ruler.cc +++ b/libs/canvas/ruler.cc @@ -180,3 +180,11 @@ Ruler::render (Rect const & area, Cairo::RefPtr cr) const /* done! */ } + +void +Ruler::set_metric (const Metric& m) +{ + _metric = &m; + _need_marks = true; + redraw (); +}