#include "canvas/ruler.h"
#include "canvas/types.h"
#include "canvas/debug.h"
-#include "canvas/utils.h"
#include "canvas/canvas.h"
using namespace std;
}
Rect self (item_to_window (get()));
- boost::optional<Rect> i = self.intersection (area);
+ Rect i = self.intersection (area);
if (!i) {
return;
}
- Rect intersection (i.get());
+ Rect intersection (i);
Distance height = self.height();
if (_divide_height >= 0) {
cr->move_to (pos.x + 2.0, self.y0 + _divide_height + logical.get_y() + 2.0); /* 2 pixel padding below divider */
} else {
- cr->move_to (pos.x + 2.0, self.y0 + logical.get_y());
+ cr->move_to (pos.x + 2.0, self.y0 + logical.get_y() + .5 * (height - logical.get_height()));
}
layout->show_in_cairo_context (cr);
}
cr->set_line_width (1.0);
- set_source_rgba (cr, _divider_color_top);
+ Gtkmm2ext::set_source_rgba (cr, _divider_color_top);
cr->move_to (self.x0, self.y0 + _divide_height-1.0+0.5);
cr->line_to (self.x1, self.y0 + _divide_height-1.0+0.5);
cr->stroke ();
- set_source_rgba (cr, _divider_color_bottom);
+ Gtkmm2ext::set_source_rgba (cr, _divider_color_bottom);
cr->move_to (self.x0, self.y0 + _divide_height+0.5);
cr->line_to (self.x1, self.y0 + _divide_height+0.5);
cr->stroke ();
}
void
-Ruler::set_divide_colors (Color t, Color b)
+Ruler::set_divide_colors (Gtkmm2ext::Color t, Gtkmm2ext::Color b)
{
_divider_color_bottom = b;
_divider_color_top = t;