From 39ef058aaa4c7ae911e2bc978a92863ceee683a8 Mon Sep 17 00:00:00 2001 From: leo Date: Sat, 21 Mar 2015 16:52:14 +0000 Subject: [PATCH] Make sure pasted pieces are added at the current step or later. --- common/lc_model.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/common/lc_model.cpp b/common/lc_model.cpp index 9f40a78d..20ac1a2c 100644 --- a/common/lc_model.cpp +++ b/common/lc_model.cpp @@ -890,10 +890,22 @@ void lcModel::Paste() lcArray PastedPieces = Model->mPieces; + for (int PieceIdx = 0; PieceIdx < PastedPieces.GetSize(); PieceIdx++) + { + lcPiece* Piece = PastedPieces[PieceIdx]; + lcStep Step = Piece->GetStepShow(); + + if (Step > mCurrentStep) + Piece->SetStepShow(mCurrentStep); + } + Merge(Model); SaveCheckpoint(tr("Pasting")); - SetSelectionAndFocus((lcArray&)PastedPieces, NULL, 0); + if (PastedPieces.GetSize() == 1) + ClearSelectionAndSetFocus(PastedPieces[0], LC_PIECE_SECTION_POSITION); + else + SetSelectionAndFocus((lcArray&)PastedPieces, NULL, 0); CalculateStep(mCurrentStep); gMainWindow->UpdateTimeline(false);