diff options
author | Carl Hetherington <carl@carlh.net> | 2009-06-14 19:01:22 +0000 |
---|---|---|
committer | Carl Hetherington <carl@carlh.net> | 2009-06-14 19:01:22 +0000 |
commit | 8051c3e76a7987e10da380d655b28771d97b6789 (patch) | |
tree | a552147eb0b70c5152dc352c057ced382d892211 /gtk2_ardour | |
parent | b23c445db98089927e99d483b8160cc179dd3b52 (diff) |
Use a filled rectangle for the view box. Colour regions using their own fill colour.
git-svn-id: svn://localhost/ardour2/branches/3.0@5192 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/editor_summary.cc | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/gtk2_ardour/editor_summary.cc b/gtk2_ardour/editor_summary.cc index 089212378b..5aba1170fc 100644 --- a/gtk2_ardour/editor_summary.cc +++ b/gtk2_ardour/editor_summary.cc @@ -5,6 +5,7 @@ #include "gui_thread.h" #include "editor.h" #include "region_view.h" +#include "rgb_macros.h" using namespace std; using namespace sigc; @@ -96,14 +97,14 @@ EditorSummary::on_expose_event (GdkEventExpose* event) cairo_t* cr = gdk_cairo_create (get_window()->gobj()); - cairo_set_source_rgba (cr, 0, 1, 0, 0.5); + cairo_set_source_rgba (cr, 0, 1, 0, 0.25); cairo_move_to (cr, x.first, y.first); cairo_line_to (cr, x.second, y.first); cairo_line_to (cr, x.second, y.second); cairo_line_to (cr, x.first, y.second); cairo_line_to (cr, x.first, y.first); - cairo_stroke (cr); + cairo_fill (cr); cairo_destroy (cr); @@ -170,9 +171,6 @@ EditorSummary::render (cairo_t* cr) double const h = (*i)->effective_height () * _vertical_scale; cairo_set_line_width (cr, h); - Gdk::Color const c = (*i)->color (); - cairo_set_source_rgb (cr, c.get_red_p (), c.get_green_p(), c.get_blue_p()); - s->foreach_regionview (bind ( mem_fun (*this, &EditorSummary::render_region), cr, @@ -194,6 +192,9 @@ EditorSummary::render (cairo_t* cr) void EditorSummary::render_region (RegionView* r, cairo_t* cr, nframes_t start, double y) const { + uint32_t const c = r->get_fill_color (); + cairo_set_source_rgb (cr, UINT_RGBA_R (c) / 255.0, UINT_RGBA_G (c) / 255.0, UINT_RGBA_B (c) / 255.0); + cairo_move_to (cr, (r->region()->position() - start) * _pixels_per_frame, y); cairo_line_to (cr, ((r->region()->position() - start + r->region()->length())) * _pixels_per_frame, y); cairo_stroke (cr); |