+
+void
+Editor::set_canvas_cursor_for_region_view (double x, RegionView* rv)
+{
+ ArdourCanvas::Group* g = rv->get_canvas_group ();
+ ArdourCanvas::Group* p = g->get_parent_group ();
+
+ /* Compute x in region view parent coordinates */
+ double dy = 0;
+ p->w2i (x, dy);
+
+ double x1, x2, y1, y2;
+ g->get_bounds (x1, y1, x2, y2);
+
+ /* Halfway across the region */
+ double const h = (x1 + x2) / 2;
+
+ Trimmable::CanTrim ct = rv->region()->can_trim ();
+ if (x <= h) {
+ if (ct & Trimmable::FrontTrimEarlier) {
+ set_canvas_cursor (_cursors->left_side_trim);
+ } else {
+ set_canvas_cursor (_cursors->left_side_trim_right_only);
+ }
+ } else {
+ if (ct & Trimmable::EndTrimLater) {
+ set_canvas_cursor (_cursors->right_side_trim);
+ } else {
+ set_canvas_cursor (_cursors->right_side_trim_left_only);
+ }
+ }
+}