From 565e759a92bdfea25cdd376ce5b27b8165a9c2aa Mon Sep 17 00:00:00 2001 From: shun-iwasawa Date: Jun 19 2018 09:36:11 +0000 Subject: fix undo / redo of move mutiple columns (#2085) --- diff --git a/toonz/sources/toonz/xsheetdragtool.cpp b/toonz/sources/toonz/xsheetdragtool.cpp index 6c0001b..6909626 100644 --- a/toonz/sources/toonz/xsheetdragtool.cpp +++ b/toonz/sources/toonz/xsheetdragtool.cpp @@ -1632,6 +1632,9 @@ public: col = currEnd; int dCol = col - (m_lastCol - m_offset); + // ignore if the cursor moves in the drag-starting column + if (dCol == 0) return; + int newBegin = *indices.begin() + dCol; int newEnd = *indices.rbegin() + dCol; @@ -1641,8 +1644,10 @@ public: newEnd > currEnd) dCol -= (newEnd - currEnd); - if (col == (m_lastCol - m_offset)) return; - m_lastCol = col + m_offset; + // ignore if the dragged columns comes up against the end of column stack + if (dCol == 0) return; + + m_lastCol += dCol; assert(*indices.begin() + dCol >= 0);