|
From: Tapio V. <aa...@us...> - 2011-01-27 08:22:20
|
Module: editor
Branch: master
Commit: 6d69ae02a2d7213aad1e70e8fdb23f6ad18e74aa
Author: Tapio Vierros <tap...@gm...>
Date: Thu Jan 27 09:54:58 2011 +0200
Fix del-function.
---
notegraphwidget.cc | 11 +++++++----
1 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/notegraphwidget.cc b/notegraphwidget.cc
index 0e9d3d3..21942d9 100644
--- a/notegraphwidget.cc
+++ b/notegraphwidget.cc
@@ -374,6 +374,9 @@ void NoteGraphWidget::split(NoteLabel *note)
{
if (!note) return;
+ if (m_selectedNote == note)
+ m_selectedNote = NULL;
+
// Cut the text in half
float relRatio = 0.5; //float(hotSpot.x()) / note->width();
int cutpos = int(std::ceil(note->lyric().length() * relRatio));
@@ -389,18 +392,18 @@ void NoteGraphWidget::split(NoteLabel *note)
Operation del("DEL"); del << id+2;
Operation combiner("COMBINER"); combiner << 3; // This will combine the previous ones to one undo action
doOperation(new1); doOperation(new2); doOperation(del); doOperation(combiner);
-
- m_selectedNote = NULL;
}
void NoteGraphWidget::del(NoteLabel *note)
{
if (!note) return;
+ if (m_selectedNote == note)
+ m_selectedNote = NULL;
+
Operation op("DEL");
- op << getNoteLabelId(m_selectedNote);
+ op << getNoteLabelId(note);
doOperation(op);
- m_selectedNote = NULL;
}
void NoteGraphWidget::editLyric(NoteLabel *note) {
|