change coordinate system used for rubberband drags in piano roll
This commit is contained in:
parent
a5b6e1676a
commit
d6dcb1c575
|
@ -225,13 +225,6 @@ MidiCueEditor::build_canvas ()
|
|||
time_line_group = new ArdourCanvas::Container (h_scroll_group);
|
||||
CANVAS_DEBUG_NAME (time_line_group, "cue time line group");
|
||||
|
||||
// used as rubberband rect
|
||||
rubberband_rect = new ArdourCanvas::Rectangle (no_scroll_group, ArdourCanvas::Rect (0.0, 0.0, 0.0, 0.0));
|
||||
rubberband_rect->hide();
|
||||
rubberband_rect->set_outline_color (UIConfiguration::instance().color ("rubber band rect"));
|
||||
rubberband_rect->set_fill_color (UIConfiguration::instance().color_mod ("rubber band rect", "selection rect"));
|
||||
CANVAS_DEBUG_NAME (rubberband_rect, X_("cue rubberband rect"));
|
||||
|
||||
meter_bar = new ArdourCanvas::Rectangle (time_line_group, ArdourCanvas::Rect (0., 0, ArdourCanvas::COORD_MAX, timebar_height));
|
||||
CANVAS_DEBUG_NAME (meter_bar, "Meter Bar");
|
||||
meter_bar->set_fill(true);
|
||||
|
@ -267,6 +260,13 @@ MidiCueEditor::build_canvas ()
|
|||
bg = new CueMidiBackground (data_group);
|
||||
_canvas_viewport->signal_size_allocate().connect (sigc::mem_fun(*this, &MidiCueEditor::canvas_allocate));
|
||||
|
||||
// used as rubberband rect
|
||||
rubberband_rect = new ArdourCanvas::Rectangle (data_group, ArdourCanvas::Rect (0.0, 0.0, 0.0, 0.0));
|
||||
rubberband_rect->hide();
|
||||
rubberband_rect->set_outline_color (UIConfiguration::instance().color ("rubber band rect"));
|
||||
rubberband_rect->set_fill_color (UIConfiguration::instance().color_mod ("rubber band rect", "selection rect"));
|
||||
CANVAS_DEBUG_NAME (rubberband_rect, X_("cue rubberband rect"));
|
||||
|
||||
prh = new ArdourCanvas::PianoRollHeader (v_scroll_group, *bg);
|
||||
|
||||
double w, h;
|
||||
|
|
|
@ -52,7 +52,7 @@ class MidiCueEditor : public CueEditor
|
|||
MidiCueEditor ();
|
||||
~MidiCueEditor ();
|
||||
|
||||
ArdourCanvas::Container* get_trackview_group () const { return no_scroll_group; }
|
||||
ArdourCanvas::Container* get_trackview_group () const { return data_group; }
|
||||
ArdourCanvas::Container* get_noscroll_group() const { return no_scroll_group; }
|
||||
Gtk::Widget& viewport();
|
||||
Gtk::Widget& toolbox ();
|
||||
|
|
|
@ -41,6 +41,11 @@ MidiCueView::MidiCueView (std::shared_ptr<ARDOUR::MidiTrack> mt,
|
|||
{
|
||||
CANVAS_DEBUG_NAME (_note_group, X_("note group for MIDI cue"));
|
||||
|
||||
/* Containers don't get canvas events, so we need an invisible rect
|
||||
* that will. It will be resized as needed sothat it always covers the
|
||||
* entire canvas/view.
|
||||
*/
|
||||
|
||||
event_rect = new ArdourCanvas::Rectangle (&parent);
|
||||
event_rect->set (ArdourCanvas::Rect (0.0, 0.0, ArdourCanvas::COORD_MAX, 10.));
|
||||
event_rect->Event.connect (sigc::mem_fun (*this, &MidiCueView::canvas_event));
|
||||
|
|
|
@ -518,16 +518,22 @@ MidiView::motion (GdkEventMotion* ev)
|
|||
MouseMode m = _editing_context.current_mouse_mode();
|
||||
|
||||
if (m == MouseContent && !Keyboard::modifier_state_contains (ev->state, Keyboard::insert_note_modifier())) {
|
||||
_editing_context.drags()->set (new MidiRubberbandSelectDrag (_editing_context, this), (GdkEvent *) ev);
|
||||
MidiRubberbandSelectDrag* mrbsd = new MidiRubberbandSelectDrag (_editing_context, this);
|
||||
mrbsd->set_bounding_item (_editing_context.get_trackview_group());
|
||||
_editing_context.drags()->set (mrbsd, (GdkEvent *) ev);
|
||||
|
||||
if (!Keyboard::modifier_state_equals (ev->state, Keyboard::TertiaryModifier)) {
|
||||
clear_selection_internal ();
|
||||
_mouse_changed_selection = true;
|
||||
}
|
||||
_mouse_state = SelectRectDragging;
|
||||
return true;
|
||||
|
||||
} else if (m == MouseRange) {
|
||||
|
||||
_editing_context.drags()->set (new MidiVerticalSelectDrag (_editing_context, this), (GdkEvent *) ev);
|
||||
_mouse_state = SelectVerticalDragging;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue