From 64b3dfcec6d080d72c71b8603ddb75830b84ea4d Mon Sep 17 00:00:00 2001 From: shun-iwasawa Date: May 09 2023 02:31:48 +0000 Subject: disable drag-moving cells option by Contrail Co.,Ltd. --- diff --git a/toonz/sources/common/tsound/tsound.cpp b/toonz/sources/common/tsound/tsound.cpp index 1bb7c48..a887d90 100644 --- a/toonz/sources/common/tsound/tsound.cpp +++ b/toonz/sources/common/tsound/tsound.cpp @@ -82,7 +82,7 @@ TSoundTrackP TSoundTrack::create(TUINT32 sampleRate, int bitPerSample, int channelCount, TINT32 sampleCount, int sampleType) { TSoundTrackP st = 0; - int type = bitPerSample + channelCount; + int type = bitPerSample + channelCount; switch (type) { case TRK_M8: if (sampleType == TSound::INT) diff --git a/toonz/sources/toonz/preferencespopup.cpp b/toonz/sources/toonz/preferencespopup.cpp index e0199df..563072b 100644 --- a/toonz/sources/toonz/preferencespopup.cpp +++ b/toonz/sources/toonz/preferencespopup.cpp @@ -1432,7 +1432,9 @@ QList PreferencesPopup::getComboItemList( {tr("Display on Column Header"), Preferences::ShowLevelNameOnColumnHeader}}}, {DragCellsBehaviour, - {{tr("Cells Only"), 0}, {tr("Cells and Column Data"), 1}}}, + {{tr("Cells Only"), 0}, + {tr("Cells and Column Data"), 1}, + {tr("Disable Dragging Cells"), 2}}}, {deleteCommandBehavior, {{tr("Clear Cell / Frame"), 0}, {tr("Remove and Shift Cells / Frames Up"), 1}}}, diff --git a/toonz/sources/toonz/xshcellviewer.cpp b/toonz/sources/toonz/xshcellviewer.cpp index bf27a8b..7ec626a 100644 --- a/toonz/sources/toonz/xshcellviewer.cpp +++ b/toonz/sources/toonz/xshcellviewer.cpp @@ -1413,6 +1413,9 @@ void CellArea::drawExtenderHandles(QPainter &p) { TCellSelection *cellSelection = m_viewer->getCellSelection(); if (cellSelection->isEmpty() || m_viewer->areSoundCellsSelected()) return; + // if the drag move is disabled, the extender handles won't appear + if (Preferences::instance()->getDragCellsBehaviour() == 2) return; + int selRow0, selCol0, selRow1, selCol1; cellSelection->getSelectedCells(selRow0, selCol0, selRow1, selCol1); @@ -3332,7 +3335,7 @@ void CellArea::mousePressEvent(QMouseEvent *event) { if (TCellKeyframeSelection *cellKeyframeSelection = dynamic_cast(selection)) setDragTool(XsheetGUI::DragTool::makeCellKeyframeMoverTool(m_viewer)); - else + else if (Preferences::instance()->getDragCellsBehaviour() != 2) setDragTool(XsheetGUI::DragTool::makeLevelMoverTool(m_viewer)); } else { m_viewer->getKeyframeSelection()->selectNone(); diff --git a/toonz/sources/toonzlib/txshsoundcolumn.cpp b/toonz/sources/toonzlib/txshsoundcolumn.cpp index 34b2c73..d84fa3e 100644 --- a/toonz/sources/toonzlib/txshsoundcolumn.cpp +++ b/toonz/sources/toonzlib/txshsoundcolumn.cpp @@ -447,7 +447,7 @@ bool TXshSoundColumn::setCell(int row, const TXshCell &cell, if (isBeforeLevelInSequence) { int oldEndOffset = lBefore->getEndOffset(); int endOffset = (lBefore->getVisibleEndFrame() != row) ? oldEndOffset - 1 - : oldEndOffset; + : oldEndOffset; if (isNextLevelInSequence) { endOffset = lNext->getEndOffset(); // Se precedente e successivo sono diversi elimino il successivo (caso in @@ -468,8 +468,8 @@ bool TXshSoundColumn::setCell(int row, const TXshCell &cell, if (isNextLevelInSequence) { int oldStartOffset = lNext->getStartOffset(); int startOffset = (lNext->getVisibleStartFrame() != row) - ? oldStartOffset - 1 - : oldStartOffset; + ? oldStartOffset - 1 + : oldStartOffset; if (l && l != lNext) { if (l->getVisibleFrameCount() == 1) removeColumnLevel(l);