Mercurial > hg > svgui
diff layer/FlexiNoteLayer.cpp @ 648:f61a54364d1d tonioni
slightly tidied george's splitEnd method
author | matthiasm |
---|---|
date | Sat, 15 Jun 2013 19:52:06 +0100 |
parents | 87fe9e05e076 |
children | 2ad082c5a090 12d570c27d85 |
line wrap: on
line diff
--- a/layer/FlexiNoteLayer.cpp Sat Jun 15 17:43:04 2013 +0100 +++ b/layer/FlexiNoteLayer.cpp Sat Jun 15 19:52:06 2013 +0100 @@ -1056,24 +1056,22 @@ return; } - FlexiNoteModel::Point note(0); + // MM simpler declaration + FlexiNote note(0); if (!getPointToDrag(v, e->x(), e->y(), note)) return; long frame = v->getFrameForX(e->x()); - FlexiNoteModel::Point newNote1 = note; - newNote1.frame = note.frame; - newNote1.value = note.value; - // newNote1.duration = note.duration+10000; - newNote1.duration = frame - note.frame - 100; - newNote1.label = note.label; - - FlexiNoteModel::Point newNote2 = note; - newNote2.frame = frame + 100; - newNote2.value = note.value; - newNote2.duration = note.duration - (frame - note.frame - 100); - newNote2.label = note.label; - + int gap = 0; // MM: I prefer a gap of 0, but we can decide later + + // MM: changed this a bit, to make it slightly clearer + FlexiNote newNote1(note.frame, note.value, + frame - note.frame - gap, + note.level, note.label); + + FlexiNote newNote2(frame, note.value, + note.duration - newNote1.duration, + note.level, note.label); FlexiNoteModel::EditCommand *command = new FlexiNoteModel::EditCommand (m_model, tr("Edit Point"));