Remove erroneous assert which I added earlier.
[ardour2.git] / gtk2_ardour / canvas-note.cc
blobf6497776a5063498271c92919383319c03bb1440
1 #include "canvas-note.h"
2 #include "midi_region_view.h"
3 #include "public_editor.h"
4 #include "evoral/Note.hpp"
6 using namespace ARDOUR;
8 namespace Gnome {
9 namespace Canvas {
11 CanvasNote::CanvasNote (MidiRegionView& region,
12 Group& group,
13 const boost::shared_ptr<NoteType> note,
14 bool with_events)
15 : SimpleRect(group), CanvasNoteEvent(region, this, note)
17 if (with_events) {
18 signal_event().connect (sigc::mem_fun (*this, &CanvasNote::on_event));
22 bool
23 CanvasNote::on_event(GdkEvent* ev)
25 if (!CanvasNoteEvent::on_event (ev)) {
26 return _region.get_time_axis_view().editor().canvas_note_event (ev, this);
29 return true;
32 void
33 CanvasNote::move_event(double dx, double dy)
35 property_x1() = property_x1() + dx;
36 property_y1() = property_y1() + dy;
37 property_x2() = property_x2() + dx;
38 property_y2() = property_y2() + dy;
40 if (_text) {
41 _text->hide();
42 _text->property_x() = _text->property_x() + dx;
43 _text->property_y() = _text->property_y() + dy;
44 _text->show();
49 } // namespace Gnome
50 } // namespace Canvas