diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2010-06-02 15:54:51 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2010-06-02 15:54:51 +0000 |
commit | f9a47cff2b7f07b769fe674f395e413fc40501fe (patch) | |
tree | 303233544e36627ecf6dd3de7e5a53f6418e1416 /gtk2_ardour/utils.cc | |
parent | 519eaabe8b7995b986b05c050b814cd09cbd4859 (diff) |
make marker labels and regionview name text (now drawn with pixbufs) be color-adjustable just like all other canvas items2.8.9
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@7212 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/utils.cc')
-rw-r--r-- | gtk2_ardour/utils.cc | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/gtk2_ardour/utils.cc b/gtk2_ardour/utils.cc index ee84cfe1da..854b5f7862 100644 --- a/gtk2_ardour/utils.cc +++ b/gtk2_ardour/utils.cc @@ -887,14 +887,21 @@ convert_bgra_to_rgba (guint8 const* src, } Glib::RefPtr<Gdk::Pixbuf> -pixbuf_from_ustring(const ustring& name, Pango::FontDescription* font, int clip_width, int clip_height) +pixbuf_from_ustring(const ustring& name, Pango::FontDescription* font, uint32_t rgba, int clip_width, int clip_height) { Glib::RefPtr<Gdk::Pixbuf> buf = Gdk::Pixbuf::create(Gdk::COLORSPACE_RGB, true, 8, clip_width, clip_height); cairo_surface_t* surface = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, clip_width, clip_height); cairo_t* cr = cairo_create (surface); cairo_text_extents_t te; - cairo_set_source_rgba (cr, 0.0, 0.0, 0.0, 1.0); + float fr, fg, fb, fa; + + fr = ((rgba & 0xff000000) >> 24) / 255.0f; + fg = ((rgba & 0xff0000) >> 16) / 255.0f; + fb = ((rgba & 0xff00) >> 8) / 255.0f; + fa = (rgba & 0xff) / 255.0f; + + cairo_set_source_rgba (cr, fr, fg, fb, fa); cairo_select_font_face (cr, font->get_family().c_str(), CAIRO_FONT_SLANT_NORMAL, CAIRO_FONT_WEIGHT_NORMAL); cairo_set_font_size (cr, font->get_size() / Pango::SCALE); |