fiddle with single pixel adjustments to time axis view item heights; fix region gain...
authorPaul Davis <paul@linuxaudiosystems.com>
Tue, 25 Feb 2014 16:35:55 +0000 (11:35 -0500)
committerPaul Davis <paul@linuxaudiosystems.com>
Tue, 25 Feb 2014 17:02:50 +0000 (12:02 -0500)
gtk2_ardour/audio_region_view.cc
gtk2_ardour/automation_line.cc
gtk2_ardour/ghostregion.cc
gtk2_ardour/time_axis_view_item.cc

index 23c84dc3405a0baaf7c944426e752c2723adbab7..cb1d10b82a824db235fdb4f2d506caf795f7d1c5 100644 (file)
@@ -449,7 +449,7 @@ void
 AudioRegionView::setup_fade_handle_positions()
 {
        /* position of fade handle offset from the top of the region view */
-       double const handle_pos = 1.0;
+       double const handle_pos = 0.0;
 
        if (fade_in_handle) {
                fade_in_handle->set_y0 (handle_pos);
@@ -572,6 +572,8 @@ AudioRegionView::reset_fade_in_shape_width (boost::shared_ptr<AudioRegion> ar, f
                effective_height = _height;
        }
 
+       effective_height -= 1.0;
+
        Points points;
 
        points.assign (npoints, Duple());
@@ -583,7 +585,7 @@ AudioRegionView::reset_fade_in_shape_width (boost::shared_ptr<AudioRegion> ar, f
 
        for (pi = 0, pc = 0; pc < npoints; ++pc) {
                points[pi].x = 1.0 + (pc * xdelta);
-               points[pi++].y = 1.0 + effective_height - (curve[pc] * effective_height);
+               points[pi++].y =  1.0 + effective_height - (curve[pc] * effective_height);
        }
 
        /* draw the line */
@@ -653,6 +655,8 @@ AudioRegionView::reset_fade_out_shape_width (boost::shared_ptr<AudioRegion> ar,
                effective_height = _height;
        }
 
+       effective_height -= 1.0;
+
        /* points *MUST* be in anti-clockwise order */
        
        Points points;
@@ -739,7 +743,7 @@ AudioRegionView::redraw_start_xfade_to (boost::shared_ptr<AudioRegion> ar, frame
                start_xfade_rect->set_data ("regionview", this);
        }
 
-       start_xfade_rect->set (ArdourCanvas::Rect (1.0, 1.0, rect_width, effective_height));
+       start_xfade_rect->set (ArdourCanvas::Rect (1.0, 0.0, rect_width, effective_height));
        start_xfade_rect->show ();
 
        start_xfade_in->set (points);
@@ -829,7 +833,7 @@ AudioRegionView::redraw_end_xfade_to (boost::shared_ptr<AudioRegion> ar, framecn
                end_xfade_rect->set_data ("regionview", this);
        }
 
-       end_xfade_rect->set (ArdourCanvas::Rect (rect_edge, 1.0, rect_edge + rect_width + TimeAxisViewItem::RIGHT_EDGE_SHIFT, effective_height));
+       end_xfade_rect->set (ArdourCanvas::Rect (rect_edge, 0.0, rect_edge + rect_width + TimeAxisViewItem::RIGHT_EDGE_SHIFT, effective_height));
        end_xfade_rect->show ();
 
        end_xfade_in->set (points);
@@ -1373,6 +1377,7 @@ AudioRegionView::envelope_active_changed ()
                gain_line->set_line_color (audio_region()->envelope_active() ? 
                                           ARDOUR_UI::config()->get_canvasvar_GainLine() : 
                                           ARDOUR_UI::config()->get_canvasvar_GainLineInactive());
+               update_envelope_visibility ();
        }
 }
 
index 5c5474346de2d210e040736e2bcad109260ef286..efba3999c8924cc1c3368ccc08155307cd86b36f 100644 (file)
@@ -1007,9 +1007,9 @@ AutomationLine::reset_callback (const Evoral::ControlList& events)
 
                line->set (line_points);
 
-               if (_visible && alist->interpolation() != AutomationList::Discrete) {
-                       line->show();
-               }
+               /* despite the name, this may show or hide things */
+
+               show();
        }
 
        set_selected_points (trackview.editor().get_selection().points);
index 5974f17bad2889c8b4e96cac220b57e50e600d51..3bdc690044962ab2f22af83037cea3d31aa95585 100644 (file)
@@ -49,8 +49,8 @@ GhostRegion::GhostRegion (ArdourCanvas::Group* parent, TimeAxisView& tv, TimeAxi
        base_rect = new ArdourCanvas::Rectangle (group);
        CANVAS_DEBUG_NAME (base_rect, "ghost region rect");
        base_rect->set_x0 (0);
-       base_rect->set_y0 (1.0);
-       base_rect->set_y1 (trackview.current_height());
+       base_rect->set_y0 (0.0);
+       base_rect->set_y1 (trackview.current_height() - 1.0);
        base_rect->set_outline_what (0);
 
        if (!is_automation_ghost()) {
index 38f9aa02f1b5277e98e9c1daa07444416477930e..cfdd032767e05723e7fd40efa45022c19c80ed32 100644 (file)
@@ -189,7 +189,7 @@ TimeAxisViewItem::init (ArdourCanvas::Group* parent, double fpp, Gdk::Color cons
 
        if (visibility & ShowFrame) {
                frame = new ArdourCanvas::Rectangle (group, 
-                                                    ArdourCanvas::Rect (0.0, 1.0, 
+                                                    ArdourCanvas::Rect (0.0, 0.0, 
                                                                         trackview.editor().sample_to_pixel(duration) + RIGHT_EDGE_SHIFT, 
                                                                         trackview.current_height() - 1.0));
 
@@ -203,13 +203,13 @@ TimeAxisViewItem::init (ArdourCanvas::Group* parent, double fpp, Gdk::Color cons
                        frame->set_outline_color (ARDOUR_UI::config()->get_canvasvar_TimeAxisFrame());
                }
 
-               // frame->set_outline_what (ArdourCanvas::Rectangle::What (ArdourCanvas::Rectangle::RIGHT|ArdourCanvas::Rectangle::LEFT));
+               frame->set_outline_what (ArdourCanvas::Rectangle::What (ArdourCanvas::Rectangle::RIGHT|ArdourCanvas::Rectangle::LEFT));
 
        } else {
 
                frame = 0;
        }
-
+       
        if (visibility & ShowNameHighlight) {
 
                double width;
@@ -227,7 +227,7 @@ TimeAxisViewItem::init (ArdourCanvas::Group* parent, double fpp, Gdk::Color cons
                                                              ArdourCanvas::Rect (start, 
                                                                                  trackview.current_height() - TimeAxisViewItem::NAME_HIGHLIGHT_SIZE, 
                                                                                  width - 2.0 + RIGHT_EDGE_SHIFT,
-                                                                                 trackview.current_height()));
+                                                                                 trackview.current_height() - 1.0));
                CANVAS_DEBUG_NAME (name_highlight, string_compose ("name highlight for %1", get_item_name()));
                name_highlight->set_data ("timeaxisviewitem", this);
                 name_highlight->set_outline_what (ArdourCanvas::Rectangle::TOP);
@@ -610,7 +610,7 @@ TimeAxisViewItem::manage_name_highlight ()
                name_highlight->show();
 
                name_highlight->set_y0 ((double) _height - NAME_HIGHLIGHT_SIZE);
-               name_highlight->set_y1 ((double) _height);
+               name_highlight->set_y1 ((double) _height - 1.0);
                
                if (visibility & FullWidthNameHighlight) {
                        /* x0 is always 0.0 */
@@ -755,7 +755,7 @@ TimeAxisViewItem::set_colors()
        set_frame_color();
 
        if (name_highlight) {
-               name_highlight->set_fill_color (fill_color);
+                name_highlight->set_fill_color (fill_color);
        }
 
        if (name_text) {