View Issue Details

IDProjectCategoryView StatusLast Update
0004744ardourbugspublic2015-09-18 15:19
Reportercolinf Assigned Tocth103  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Target Version3.0 
Summary0004744: [PATCH] Impossible to select short regions to drag &c.
DescriptionWith the new behaviour of the 'trim' cursor appearing over the whole height of the left & right ends, it's impossible to select or drag short regions without zooming in on them enough for the left- and right-trim cursor zones to not overlap. I'm finding this quite an impediment compares to the behaviour of A2.
TagsNo tags attached.

Activities

colinf

2012-04-30 18:15

updater   ~0013214

I think this is due to a missing 'else' in gtk2_ardour/time_axis_view_item.cc, though I found a few other confusing things in there as well.

Anyway, small patch follows shortly...

2012-04-30 18:24

 

short-region-hide-frame-handle.patch (3,300 bytes)   
Index: gtk2_ardour/time_axis_view_item.cc
===================================================================
--- gtk2_ardour/time_axis_view_item.cc	(revision 12125)
+++ gtk2_ardour/time_axis_view_item.cc	(working copy)
@@ -52,7 +52,8 @@
 
 Pango::FontDescription TimeAxisViewItem::NAME_FONT;
 const double TimeAxisViewItem::NAME_X_OFFSET = 15.0;
-const double TimeAxisViewItem::GRAB_HANDLE_LENGTH = 6;
+const double TimeAxisViewItem::GRAB_HANDLE_TOP = 6;
+const double TimeAxisViewItem::GRAB_HANDLE_WIDTH = 5;
 
 int    TimeAxisViewItem::NAME_HEIGHT;
 double TimeAxisViewItem::NAME_Y_OFFSET;
@@ -215,9 +216,12 @@
 
 	/* create our grab handles used for trimming/duration etc */
 	if (!_recregion && !_automation) {
-		frame_handle_start = new ArdourCanvas::SimpleRect (*group, 0.0, TimeAxisViewItem::GRAB_HANDLE_LENGTH, 5.0, trackview.current_height());
+		double top   = TimeAxisViewItem::GRAB_HANDLE_TOP;
+		double width = TimeAxisViewItem::GRAB_HANDLE_WIDTH;
+
+		frame_handle_start = new ArdourCanvas::SimpleRect (*group, 0.0, top, width, trackview.current_height());
 		frame_handle_start->property_outline_what() = 0x0;
-		frame_handle_end = new ArdourCanvas::SimpleRect (*group, 0.0, TimeAxisViewItem::GRAB_HANDLE_LENGTH, 5.0, trackview.current_height());
+		frame_handle_end = new ArdourCanvas::SimpleRect (*group, 0.0, top, width, trackview.current_height());
 		frame_handle_end->property_outline_what() = 0x0;
 	} else {
 		frame_handle_start = frame_handle_end = 0;
@@ -807,15 +811,7 @@
 void
 TimeAxisViewItem::reset_width_dependent_items (double pixel_width)
 {
-	if (pixel_width < GRAB_HANDLE_LENGTH * 2) {
 
-		if (frame_handle_start) {
-			frame_handle_start->hide();
-			frame_handle_end->hide();
-		}
-
-	}
-
 	if (pixel_width < 2.0) {
 
 		if (show_vestigial) {
@@ -862,14 +858,20 @@
 		}
 
 		if (frame_handle_start) {
-			if (pixel_width < (2*TimeAxisViewItem::GRAB_HANDLE_LENGTH)) {
+			if (pixel_width < (3 * TimeAxisViewItem::GRAB_HANDLE_WIDTH)) {
+				/*
+				 * there's less than GRAB_HANDLE_WIDTH of the region between 
+				 * the right-hand end of frame_handle_start and the left-hand
+				 * end of frame_handle_end, so disable the handles
+				 */
 				frame_handle_start->hide();
 				frame_handle_end->hide();
+			} else {
+				frame_handle_start->show();
+				frame_handle_end->property_x1() = pixel_width - (TimeAxisViewItem::GRAB_HANDLE_WIDTH);
+				frame_handle_end->property_x2() = pixel_width;
+				frame_handle_end->show();
 			}
-			frame_handle_start->show();
-			frame_handle_end->property_x1() = pixel_width - (TimeAxisViewItem::GRAB_HANDLE_LENGTH);
-			frame_handle_end->show();
-			frame_handle_end->property_x2() = pixel_width;
 		}
 
 		wide_enough_for_name = true;
Index: gtk2_ardour/time_axis_view_item.h
===================================================================
--- gtk2_ardour/time_axis_view_item.h	(revision 12125)
+++ gtk2_ardour/time_axis_view_item.h	(working copy)
@@ -93,7 +93,8 @@
 	static Pango::FontDescription NAME_FONT;
 	static void set_constant_heights ();
 	static const double NAME_X_OFFSET;
-	static const double GRAB_HANDLE_LENGTH;
+	static const double GRAB_HANDLE_TOP;
+	static const double GRAB_HANDLE_WIDTH;
 
 	/* these are not constant, but vary with the pixel size
 	   of the font used to display the item name.

colinf

2012-04-30 18:27

updater   ~0013215

Last edited: 2012-04-30 18:30

Attached patch:
 * adds the missing 'else'
 * renames the constant GRAB_HANDLE_LENGTH to GRAB_HANDLE_TOP (since that's what it is)
 * adds a new GRAB_HANDLE_WIDTH constant
 * ensures that there's never less than a GRAB_HANDLE_WIDTH of region between the start and end trim zones
 * removes a few unnecessary duplicated lines

cth103

2012-04-30 23:01

administrator   ~0013216

Thanks, applied to SVN 12128.

colinf

2015-09-18 15:19

updater   ~0017299

Closing old issues reported by me: these have long since been fixed.

Issue History

Date Modified Username Field Change
2012-02-27 14:47 colinf New Issue
2012-02-27 14:48 cth103 cost => 0.00
2012-02-27 14:48 cth103 Target Version => 3.0 beta4
2012-04-30 18:15 colinf Note Added: 0013214
2012-04-30 18:24 colinf File Added: short-region-hide-frame-handle.patch
2012-04-30 18:27 colinf Note Added: 0013215
2012-04-30 18:30 colinf Note Edited: 0013215
2012-04-30 18:33 colinf Summary Impossible to select short regions to drag &c. => [PATCH] Impossible to select short regions to drag &c.
2012-04-30 23:01 cth103 Note Added: 0013216
2012-04-30 23:01 cth103 Status new => resolved
2012-04-30 23:01 cth103 Resolution open => fixed
2012-04-30 23:01 cth103 Assigned To => cth103
2012-05-23 15:07 cth103 Target Version 3.0 beta4 => 3.0
2015-09-18 15:19 colinf Note Added: 0017299
2015-09-18 15:19 colinf Status resolved => closed