Drag zoom area now fills the whole canvas
authorSampo Savolainen <v2@iki.fi>
Mon, 4 Dec 2006 22:18:21 +0000 (22:18 +0000)
committerSampo Savolainen <v2@iki.fi>
Mon, 4 Dec 2006 22:18:21 +0000 (22:18 +0000)
git-svn-id: svn://localhost/ardour2/trunk@1188 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/editor.h
gtk2_ardour/editor_canvas.cc
gtk2_ardour/editor_mouse.cc

index 85f866e923451f9e0352e80046cface85464bb0b..39b4b932222ce5aa2c4f0694341976aa6975521b 100644 (file)
@@ -654,6 +654,7 @@ class Editor : public PublicEditor
 
        double canvas_width;
        double canvas_height;
+       double full_canvas_height;
        nframes_t last_canvas_frame;
 
        bool track_canvas_map_handler (GdkEventAny*);
index 8f6203c40da9b7ea5fd6f1195c1a57d7ee79657e..4a1fc10b9c1926a2b8a5363f68257be871e78e44 100644 (file)
@@ -294,7 +294,6 @@ Editor::track_canvas_allocate (Gtk::Allocation alloc)
 bool
 Editor::track_canvas_idle ()
 {
-
        if (canvas_idle_queued) {
                canvas_idle_queued = false;
        }
@@ -302,6 +301,27 @@ Editor::track_canvas_idle ()
        canvas_width = canvas_allocation.get_width();
        canvas_height = canvas_allocation.get_height();
 
+       full_canvas_height = canvas_height;
+
+       if (session) {
+               TrackViewList::iterator i;
+               double height = 0;
+
+               for (i = track_views.begin(); i != track_views.end(); ++i) {
+                       if ((*i)->control_parent) {
+                               height += (*i)->effective_height;
+                               height += track_spacing;
+                       }
+               }
+               
+               if (height) {
+                       height -= track_spacing;
+               }
+
+               full_canvas_height = height;
+       }
+
+
        zoom_range_clock.set ((nframes_t) floor ((canvas_width * frames_per_unit)));
        edit_cursor->set_position (edit_cursor->current_frame);
        playhead_cursor->set_position (playhead_cursor->current_frame);
index a921c64615c0a11c5d4f57aeeb4a2a00b754c93f..76a40de95f02e96e0d22520fb96d45806852d640 100644 (file)
@@ -2794,6 +2794,7 @@ Editor::region_drag_motion_callback (ArdourCanvas::Item* item, GdkEvent* event)
                set<Playlist*> affected_playlists;
                pair<set<Playlist*>::iterator,bool> insert_result;
                
+               // TODO: Crossfades need to be copied!
                for (list<RegionView*>::const_iterator i = selection->regions.by_layer().begin(); i != selection->regions.by_layer().end(); ++i) {
                        RegionView* rv;
                        
@@ -2835,6 +2836,8 @@ Editor::region_drag_motion_callback (ArdourCanvas::Item* item, GdkEvent* event)
                                new_regionviews.push_back (latest_regionview);
                        }
                }
+
+               
                
                if (new_regionviews.empty()) {
                        return;
@@ -4599,7 +4602,7 @@ Editor::reposition_zoom_rect (nframes_t start, nframes_t end)
 {
        double x1 = frame_to_pixel (start);
        double x2 = frame_to_pixel (end);
-       double y2 = canvas_height - 2;
+       double y2 = full_canvas_height - 1.0;
 
        zoom_rect->property_x1() = x1;
        zoom_rect->property_y1() = 1.0;