From b1b9457e6e3d4ad7a1c6e861b4129ed691a8d754 Mon Sep 17 00:00:00 2001 From: Rodney Date: Apr 22 2021 15:07:44 +0000 Subject: Merge pull request #3922 from shun-iwasawa/fix_cell_selection_on_click Fix Cell Selection on Click --- diff --git a/toonz/sources/toonz/xsheetdragtool.cpp b/toonz/sources/toonz/xsheetdragtool.cpp index ea52e50..5166646 100644 --- a/toonz/sources/toonz/xsheetdragtool.cpp +++ b/toonz/sources/toonz/xsheetdragtool.cpp @@ -128,6 +128,12 @@ public: int col = pos.layer(); m_firstCol = col; m_firstRow = row; + // First, check switching of the selection types. This may clear the + // previous selection. + if (m_modifier & Qt::ControlModifier) + getViewer()->getCellKeyframeSelection()->makeCurrent(); + else + getViewer()->getCellSelection()->makeCurrent(); if (m_modifier & Qt::ShiftModifier) { int r0, c0, r1, c1; getViewer()->getCellSelection()->getSelectedCells(r0, c0, r1, c1); @@ -170,10 +176,6 @@ public: else getViewer()->getCellSelection()->selectCell(row, col); } - if (m_modifier & Qt::ControlModifier) - getViewer()->getCellKeyframeSelection()->makeCurrent(); - else - getViewer()->getCellSelection()->makeCurrent(); refreshCellsArea(); refreshRowsArea(); }