Patch from colinf to fix selection of short regions (#4744).
git-svn-id: svn://localhost/ardour2/branches/3.0@12128 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
7314f66b95
commit
01659c1d73
@ -52,7 +52,8 @@ using namespace Gtkmm2ext;
|
|||||||
|
|
||||||
Pango::FontDescription TimeAxisViewItem::NAME_FONT;
|
Pango::FontDescription TimeAxisViewItem::NAME_FONT;
|
||||||
const double TimeAxisViewItem::NAME_X_OFFSET = 15.0;
|
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;
|
int TimeAxisViewItem::NAME_HEIGHT;
|
||||||
double TimeAxisViewItem::NAME_Y_OFFSET;
|
double TimeAxisViewItem::NAME_Y_OFFSET;
|
||||||
@ -215,9 +216,12 @@ TimeAxisViewItem::init (
|
|||||||
|
|
||||||
/* create our grab handles used for trimming/duration etc */
|
/* create our grab handles used for trimming/duration etc */
|
||||||
if (!_recregion && !_automation) {
|
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_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;
|
frame_handle_end->property_outline_what() = 0x0;
|
||||||
} else {
|
} else {
|
||||||
frame_handle_start = frame_handle_end = 0;
|
frame_handle_start = frame_handle_end = 0;
|
||||||
@ -807,14 +811,6 @@ TimeAxisViewItem::set_samples_per_unit (double spu)
|
|||||||
void
|
void
|
||||||
TimeAxisViewItem::reset_width_dependent_items (double pixel_width)
|
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 (pixel_width < 2.0) {
|
||||||
|
|
||||||
@ -862,14 +858,20 @@ TimeAxisViewItem::reset_width_dependent_items (double pixel_width)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (frame_handle_start) {
|
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_start->hide();
|
||||||
frame_handle_end->hide();
|
frame_handle_end->hide();
|
||||||
}
|
} else {
|
||||||
frame_handle_start->show();
|
frame_handle_start->show();
|
||||||
frame_handle_end->property_x1() = pixel_width - (TimeAxisViewItem::GRAB_HANDLE_LENGTH);
|
frame_handle_end->property_x1() = pixel_width - (TimeAxisViewItem::GRAB_HANDLE_WIDTH);
|
||||||
frame_handle_end->show();
|
|
||||||
frame_handle_end->property_x2() = pixel_width;
|
frame_handle_end->property_x2() = pixel_width;
|
||||||
|
frame_handle_end->show();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
wide_enough_for_name = true;
|
wide_enough_for_name = true;
|
||||||
|
@ -93,7 +93,8 @@ class TimeAxisViewItem : public Selectable, public PBD::ScopedConnectionList
|
|||||||
static Pango::FontDescription NAME_FONT;
|
static Pango::FontDescription NAME_FONT;
|
||||||
static void set_constant_heights ();
|
static void set_constant_heights ();
|
||||||
static const double NAME_X_OFFSET;
|
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
|
/* these are not constant, but vary with the pixel size
|
||||||
of the font used to display the item name.
|
of the font used to display the item name.
|
||||||
|
Loading…
Reference in New Issue
Block a user