ArdourCanvas::Rect scrolling_boundary;
Gtk::Allocation alloc;
- int cx, cy;
if (from_headers) {
alloc = controls_layout.get_allocation ();
} else {
alloc = _track_canvas_viewport->get_allocation ();
- cx = alloc.get_x();
- cy = alloc.get_y();
/* reduce height by the height of the timebars, which happens
to correspond to the position of the hv_scroll_group.
Gdk::ModifierType mask;
frameoffset_t dx = 0;
bool no_stop = false;
- bool y_motion = false;
get_window()->get_pointer (x, y, mask);
VisualChange vc;
bool vertical_motion = false;
+ bool y_motion = false;
if (autoscroll_horizontal_allowed) {
/* scroll to make higher tracks visible */
if (autoscroll_cnt && (autoscroll_cnt % speed_factor == 0)) {
- y_motion = scroll_up_one_track ();
+ scroll_up_one_track ();
vertical_motion = true;
}
} else if (y > autoscroll_boundary.y1) {
if (autoscroll_cnt && (autoscroll_cnt % speed_factor == 0)) {
- y_motion = scroll_down_one_track ();
+ scroll_down_one_track ();
vertical_motion = true;
}
}
}
void
-Editor::_ensure_time_axis_view_is_visible (TimeAxisView const & track, bool at_top)
+Editor::ensure_time_axis_view_is_visible (TimeAxisView const & track, bool at_top)
{
if (track.hidden()) {
return;
double const track_max_y = track.y_position () + track.effective_height ();
if (!at_top &&
- (track_min_y > current_view_min_y &&
- track_max_y <= current_view_max_y)) {
+ (track_min_y >= current_view_min_y &&
+ track_max_y < current_view_max_y)) {
+ /* already visible, and caller did not ask to place it at the
+ * top of the track canvas
+ */
return;
}
double new_value;
- if (track_min_y < current_view_min_y) {
- // Track is above the current view
+ if (at_top) {
new_value = track_min_y;
} else {
- // Track is below the current view
- new_value = track.y_position () + track.effective_height() - vertical_adjustment.get_page_size();
+ if (track_min_y < current_view_min_y) {
+ // Track is above the current view
+ new_value = track_min_y;
+ } else if (track_max_y > current_view_max_y) {
+ // Track is below the current view
+ new_value = track.y_position () + track.effective_height() - vertical_adjustment.get_page_size();
+ } else {
+ new_value = track_min_y;
+ }
}
vertical_adjustment.set_value(new_value);
}
break;
+ case MouseCut:
+ mode_cursor = _cursors->scissors;
+ break;
+
case MouseObject:
/* don't use mode cursor, pick a grabber cursor based on the item */
break;
cursor = _cursors->cross_hair;
break;
case LeftFrameHandle:
- cursor = which_trim_cursor (true);
+ if ( effective_mouse_mode() == MouseObject ) // (smart mode): if the user is in the top half, override the trim cursor, since they are in the range zone
+ cursor = which_trim_cursor (true); //alternatively, one could argue that we _should_ allow trims here, and disallow range selection
break;
case RightFrameHandle:
- cursor = which_trim_cursor (false);
+ if ( effective_mouse_mode() == MouseObject ) //see above
+ cursor = which_trim_cursor (false);
break;
case StartCrossFadeItem:
cursor = _cursors->fade_in;
case CdMarkerBarItem:
case VideoBarItem:
case TransportMarkerBarItem:
+ case DropZoneItem:
cursor = which_grabber_cursor();
break;
set_canvas_cursor (cursor, false);
}
}
+
+double
+Editor::trackviews_height() const
+{
+ if (!_trackview_group) {
+ return 0;
+ }
+
+ return _visible_canvas_height - _trackview_group->canvas_origin().y;
+}