Make sure pasted pieces are added at the current step or later.

This commit is contained in:
leo 2015-03-21 16:52:14 +00:00
parent 406182db5d
commit 39ef058aaa

View file

@ -890,10 +890,22 @@ void lcModel::Paste()
lcArray<lcPiece*> 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<lcObject*>&)PastedPieces, NULL, 0);
if (PastedPieces.GetSize() == 1)
ClearSelectionAndSetFocus(PastedPieces[0], LC_PIECE_SECTION_POSITION);
else
SetSelectionAndFocus((lcArray<lcObject*>&)PastedPieces, NULL, 0);
CalculateStep(mCurrentStep);
gMainWindow->UpdateTimeline(false);