#include "canvas/text.h"
#include "canvas/canvas.h"
-#include "canvas/utils.h"
-#include "canvas/colors.h"
+#include "gtkmm2ext/colors.h"
using namespace std;
using namespace ArdourCanvas;
Glib::RefPtr<Pango::Context> context = _canvas->get_pango_context();
Glib::RefPtr<Pango::Layout> layout = Pango::Layout::create (context);
-#ifdef __APPLE__
+#if 0 // def __APPLE__ // Looks like this is no longer needed 2017-03-11, pango 1.36.8, pangomm 2.34.0
if (_width_correction < 0.0) {
// Pango returns incorrect text width on some OS X
// So we have to make a correction
/* and draw, in the appropriate color of course */
if (_outline) {
- set_source_rgba (img_context, _outline_color);
+ Gtkmm2ext::set_source_rgba (img_context, _outline_color);
layout->update_from_cairo_context (img_context);
pango_cairo_layout_path (img_context->cobj(), layout->gobj());
img_context->stroke_preserve ();
- set_source_rgba (img_context, _color);
+ Gtkmm2ext::set_source_rgba (img_context, _color);
img_context->fill ();
} else {
- set_source_rgba (img_context, _color);
+ Gtkmm2ext::set_source_rgba (img_context, _color);
layout->show_in_cairo_context (img_context);
}
}
Rect self = item_to_window (Rect (0, 0, min (_clamped_width, (double)_image->get_width ()), _image->get_height ()));
- boost::optional<Rect> i = self.intersection (area);
+ Rect i = self.intersection (area);
if (!i) {
return;
_redraw ();
}
- Rect intersection (i.get());
+ Rect intersection (i);
context->rectangle (intersection.x0, intersection.y0, intersection.width(), intersection.height());
#ifdef __APPLE__
Text::compute_bounding_box () const
{
if (!_canvas || _text.empty()) {
- _bounding_box = boost::optional<Rect> ();
+ _bounding_box = Rect ();
_bounding_box_dirty = false;
return;
}
}
void
-Text::set_color (Color color)
+Text::set_color (Gtkmm2ext::Color color)
{
if (color == _color) {
return;
_color = color;
if (_outline) {
- set_outline_color (contrasting_text_color (_color));
+ set_outline_color (Gtkmm2ext::contrasting_text_color (_color));
}
_need_redraw = true;