From 03912c503966f7fedca4b9f5c19fa9a75ad58f11 Mon Sep 17 00:00:00 2001 From: manongjohn Date: Jan 23 2018 03:52:44 +0000 Subject: Shift-Drag Keyframe fix (#1687) close #1671 --- diff --git a/toonz/sources/toonz/cellselection.cpp b/toonz/sources/toonz/cellselection.cpp index 42a2ee9..77f3109 100644 --- a/toonz/sources/toonz/cellselection.cpp +++ b/toonz/sources/toonz/cellselection.cpp @@ -1583,7 +1583,10 @@ void TCellSelection::pasteCells() { // Retrieves all keyframe positions from mime data and translates them by // (r0,c0) std::set positions; - positions.insert(TKeyframeSelection::Position(r0, c0)); + int newC0 = c0; + if (viewer && !viewer->orientation()->isVerticalTimeline()) + newC0 = c0 - keyframeData->getColumnSpanCount() + 1; + positions.insert(TKeyframeSelection::Position(r0, newC0)); keyframeData->getKeyframes(positions); selection.select(positions); @@ -1787,8 +1790,12 @@ void TCellSelection::pasteKeyframesInto() { } else { // Retrieves all keyframe positions from mime data and translates them by // (r0,c0) + XsheetViewer *viewer = TApp::instance()->getCurrentXsheetViewer(); std::set positions; - positions.insert(TKeyframeSelection::Position(r0, c0)); + int newC0 = c0; + if (viewer && !viewer->orientation()->isVerticalTimeline()) + newC0 = c0 - keyframeData->getColumnSpanCount() + 1; + positions.insert(TKeyframeSelection::Position(r0, newC0)); keyframeData->getKeyframes(positions); selection.select(positions); } diff --git a/toonz/sources/toonz/keyframedata.cpp b/toonz/sources/toonz/keyframedata.cpp index b3afd6e..73f6bae 100644 --- a/toonz/sources/toonz/keyframedata.cpp +++ b/toonz/sources/toonz/keyframedata.cpp @@ -80,8 +80,6 @@ bool TKeyframeData::getKeyframes(std::set &positions, } XsheetViewer *viewer = TApp::instance()->getCurrentXsheetViewer(); - if (viewer && !viewer->orientation()->isVerticalTimeline()) - c0 -= m_columnSpanCount - 1; positions.clear(); TStageObjectId cameraId = xsh->getStageObjectTree()->getCurrentCameraId();