Fix the User button for Mixbus; we use it as a button, not a modifier.
[ardour.git] / libs / canvas / text.cc
index 735b9b87f82e6edf7489b70edbe46d931dbcc051..19c4b417f9dc595c74a08d16e5e9959d85cce96e 100644 (file)
@@ -27,8 +27,7 @@
 
 #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;
@@ -110,7 +109,7 @@ Text::_redraw () const
        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
@@ -169,14 +168,14 @@ Text::_redraw () const
        /* 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);
        }
 
@@ -195,7 +194,7 @@ Text::render (Rect const & area, Cairo::RefPtr<Cairo::Context> context) const
        }
 
        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;
@@ -205,7 +204,7 @@ Text::render (Rect const & area, Cairo::RefPtr<Cairo::Context> context) const
                _redraw ();
        }
 
-       Rect intersection (i.get());
+       Rect intersection (i);
 
        context->rectangle (intersection.x0, intersection.y0, intersection.width(), intersection.height());
 #ifdef __APPLE__
@@ -238,7 +237,7 @@ void
 Text::compute_bounding_box () const
 {
        if (!_canvas || _text.empty()) {
-               _bounding_box = boost::optional<Rect> ();
+               _bounding_box = Rect ();
                _bounding_box_dirty = false;
                return;
        }
@@ -286,7 +285,7 @@ Text::set_font_description (Pango::FontDescription font_description)
 }
 
 void
-Text::set_color (Color color)
+Text::set_color (Gtkmm2ext::Color color)
 {
        if (color == _color) {
                return;
@@ -296,7 +295,7 @@ Text::set_color (Color color)
 
        _color = color;
        if (_outline) {
-               set_outline_color (contrasting_text_color (_color));
+               set_outline_color (Gtkmm2ext::contrasting_text_color (_color));
        }
        _need_redraw = true;