summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorSampo Savolainen <v2@iki.fi>2006-12-04 22:18:21 +0000
committerSampo Savolainen <v2@iki.fi>2006-12-04 22:18:21 +0000
commit317af79f13d60811d8942c943a7b081b913da0a0 (patch)
treee80511a784571ee74375bcf76ffe2651901f78bd /gtk2_ardour
parentf599eefa998c9b971b797bbecc53cb49f1d3ca3c (diff)
Drag zoom area now fills the whole canvas
git-svn-id: svn://localhost/ardour2/trunk@1188 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/editor.h1
-rw-r--r--gtk2_ardour/editor_canvas.cc22
-rw-r--r--gtk2_ardour/editor_mouse.cc5
3 files changed, 26 insertions, 2 deletions
diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h
index 85f866e923..39b4b93222 100644
--- a/gtk2_ardour/editor.h
+++ b/gtk2_ardour/editor.h
@@ -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*);
diff --git a/gtk2_ardour/editor_canvas.cc b/gtk2_ardour/editor_canvas.cc
index 8f6203c40d..4a1fc10b9c 100644
--- a/gtk2_ardour/editor_canvas.cc
+++ b/gtk2_ardour/editor_canvas.cc
@@ -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);
diff --git a/gtk2_ardour/editor_mouse.cc b/gtk2_ardour/editor_mouse.cc
index a921c64615..76a40de95f 100644
--- a/gtk2_ardour/editor_mouse.cc
+++ b/gtk2_ardour/editor_mouse.cc
@@ -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;