From f48b5568883468e70a751ec1aa934e5a55bb7705 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Thu, 13 Mar 2014 11:02:06 -0400 Subject: [PATCH] do not use Item::move() when dragging notes since this resets the Item's position in its group, rather than its coordinates. This fixes the double-distance/wrongly drawn location of MIDI notes after a drag --- gtk2_ardour/hit.cc | 7 ++++++- gtk2_ardour/note.cc | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/gtk2_ardour/hit.cc b/gtk2_ardour/hit.cc index feb8ca43db..69dd8d5bc8 100644 --- a/gtk2_ardour/hit.cc +++ b/gtk2_ardour/hit.cc @@ -47,7 +47,12 @@ Hit::~Hit () void Hit::move_event (double dx, double dy) { - _polygon->move (Duple (dx, dy)); + Points points = _polygon->get(); + Points moved; + for (Points::iterator p = points.begin(); p != points.end(); ++p) { + moved.push_back ((*p).translate (ArdourCanvas::Duple (dx, dy))); + } + _polygon->set (moved); } void diff --git a/gtk2_ardour/note.cc b/gtk2_ardour/note.cc index 02475f859c..3adcd751f8 100644 --- a/gtk2_ardour/note.cc +++ b/gtk2_ardour/note.cc @@ -47,7 +47,7 @@ Note::~Note () void Note::move_event (double dx, double dy) { - _rectangle->move (Duple (dx, dy)); + _rectangle->set (_rectangle->get().translate (Duple (dx, dy))); } Coord