Skip to content

Commit 51af060

Browse files
committed
fixed deselection of notes on note-move
hey man
1 parent e333351 commit 51af060

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

CHANGELOG.txt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,6 @@
77

88
1.1
99

10-
-- TODO: Fix deselection of notes on note-move.
11-
12-
-- TODO: Fix badly-sized notes on undo-after-mod-duration.
13-
1410
-- TODO: Remove unnecessary 'undo-suppression' vars from function-calls and undo-funcs.
1511

1612
-- TODO: Test all commands again, especially Entry-Quantize, to check for bugs caused by refactoring / new features.
@@ -60,6 +56,7 @@
6056
-- Changed the rendering properties of the notes within a sequence's non-active channels, both in their default state and while selected.
6157

6258
* Logic changes:
59+
-- Fixed deselection of notes on note-move.
6360
-- Fixed a nasty bug in removeSequence that was incurred by changes in modNotes. Also added setTicks and removed several outdated functions in the process.
6461
-- Decoupled modSelectedNotes commands from spacing. They now stick to beat-factor horizontally, and have 1-and-12-spaced variants vertically.
6562
-- Stopped keyboard-notes from incurring new undo-blocks when not in Record Mode.

funcs/modify-funcs.lua

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ return {
5252
modNotes = function(p, ntab, isselect, multiply, undo)
5353

5454
local snotes = {}
55+
local renewnotes = {}
5556

5657
-- For every note, in order, add the mod-command's results to the snotes table
5758
for nk, ntab in ipairs(ntab) do
@@ -68,10 +69,10 @@ return {
6869
table.insert(snotes, {'remove', n})
6970
table.insert(snotes, {'insert', m})
7071

71-
-- Unset the note's old selection-data entry, and build a new entry reflecting its changes
72+
-- Unset the note's old selection-data entry, and build a new temp-entry reflecting its changes
7273
if isselect then
7374
copyUnsetCascade('seldat', n)
74-
buildTable(D.seldat, {m[2] + 1, m[4], m[5]}, m)
75+
table.insert(renewnotes, m)
7576
end
7677

7778
end
@@ -81,6 +82,13 @@ return {
8182
-- Call setNotes for all tabbed modifications
8283
setNotes(p, snotes, undo)
8384

85+
-- If there was a selection, rebuild the selection-table from the accurate temp-entries
86+
if isselect then
87+
for k, v in pairs(renewnotes) do
88+
buildTable(D.seldat, {v[2] + 1, v[4], v[5]}, v)
89+
end
90+
end
91+
8492
end,
8593

8694
-- Take a note, modify a given byte within that note by a given amount, and return it

0 commit comments

Comments
 (0)