|
From: Tapio V. <aa...@us...> - 2011-02-04 08:01:47
|
Module: editor
Branch: master
Commit: d56d2b3198ff5517f514b5e74a481515572cf752
Author: Tapio Vierros <tap...@gm...>
Date: Fri Feb 4 10:00:04 2011 +0200
Fix "NEW" and "MOVE" to extract doubles from the Operation.
This makes undo work properly.
---
notelabelmanager.cc | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/notelabelmanager.cc b/notelabelmanager.cc
index a603017..4774957 100644
--- a/notelabelmanager.cc
+++ b/notelabelmanager.cc
@@ -190,8 +190,8 @@ void NoteLabelManager::doOperation(const Operation& op, Operation::OperationFlag
NoteLabel *newLabel = new NoteLabel(
Note(op.s(2)), // Note(lyric)
this, // parent
- QPoint(s2px(op.i(3)), n2px(op.i(5))), // x,y
- QSize(s2px(op.i(4) - op.i(3)), 2 * m_noteHalfHeight), // w,h
+ QPoint(s2px(op.d(3)), n2px(op.i(5))), // x,y
+ QSize(s2px(op.d(4) - op.d(3)), 2 * m_noteHalfHeight), // w,h
op.b(6) // floating
);
if (m_notes.isEmpty()) m_notes.push_back(newLabel);
@@ -203,7 +203,7 @@ void NoteLabelManager::doOperation(const Operation& op, Operation::OperationFlag
n->close();
m_notes.removeAt(op.i(1));
} else if (action == "MOVE") {
- n->setGeometry(s2px(op.i(2)), n2px(op.i(4)) - m_noteHalfHeight, s2px(op.i(3) - op.i(2)), 2 * m_noteHalfHeight);
+ n->setGeometry(s2px(op.d(2)), n2px(op.i(4)) - m_noteHalfHeight, s2px(op.d(3) - op.d(2)), 2 * m_noteHalfHeight);
n->setFloating(false);
} else if (action == "FLOATING") {
n->setFloating(op.b(2));
|