From e6fa6d33fa918275d2502cf72ebe3e5fd8f5df16 Mon Sep 17 00:00:00 2001 From: Zithia Satazaki Date: Tue, 29 Mar 2022 14:06:12 -0400 Subject: [PATCH] fix note preview stuff on pattern editor --- notes | 6 ++++-- xybrid/ui/patterneditoritemdelegate.cpp | 1 + xybrid/ui/patterneditorview.cpp | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/notes b/notes index 0ac0307..d1bf9f2 100644 --- a/notes +++ b/notes @@ -40,9 +40,11 @@ TODO { maybe scroll sensitivity } - revert-to-saved menu action + - fix space on note or port column (previewing) generating an undo action + - make space preview on port column + fix strut not working except to overwrite another param - - distortion effect + revert-to-saved menu action automation node { listens for one specific param diff --git a/xybrid/ui/patterneditoritemdelegate.cpp b/xybrid/ui/patterneditoritemdelegate.cpp index cee6c81..685e7d2 100644 --- a/xybrid/ui/patterneditoritemdelegate.cpp +++ b/xybrid/ui/patterneditoritemdelegate.cpp @@ -198,6 +198,7 @@ bool PatternEditorItemDelegate::editorEvent(QEvent *event, QAbstractItemModel *m dc->cancel(); SelectionBounds s(sel); + if (s.x1 == s.x2 && s.x1 % PatternEditorModel::colsPerChannel <= 1) return false; // just previewing the note column auto* cc = (new CompositeCommand())->reserve((1 + s.y2 - s.y1) * (1 + s.ch2 - s.ch1)); for (int c = s.ch1; c <= s.ch2; c++) { diff --git a/xybrid/ui/patterneditorview.cpp b/xybrid/ui/patterneditorview.cpp index 2bd7a12..9c769ee 100644 --- a/xybrid/ui/patterneditorview.cpp +++ b/xybrid/ui/patterneditorview.cpp @@ -307,7 +307,7 @@ void PatternEditorView::startPreview(int key) { auto ind = currentIndex(); int cc = ind.column() % PatternEditorModel::colsPerChannel; int ch = (ind.column() - cc) / PatternEditorModel::colsPerChannel; - if (cc == 1) { // note column + if (cc == 1 || (cc == 0 && key == Qt::Key_Space)) { // note column or space on port stopPreview(key); // end current preview first, if applicable auto& r = mdl->getPattern()->rowAt(ch, ind.row()-1); auto p = mdl->getPattern()->project->shared_from_this();