diff --git a/src/app/commands/cmd_paste_text.cpp b/src/app/commands/cmd_paste_text.cpp index fc82e230f..9c4b91012 100644 --- a/src/app/commands/cmd_paste_text.cpp +++ b/src/app/commands/cmd_paste_text.cpp @@ -1,5 +1,5 @@ // Aseprite -// Copyright (C) 2019 Igara Studio S.A. +// Copyright (C) 2019-2020 Igara Studio S.A. // Copyright (C) 2001-2018 David Capello // // This program is distributed under the terms of @@ -19,6 +19,7 @@ #include "app/ui/drop_down_button.h" #include "app/ui/editor/editor.h" #include "app/ui/font_popup.h" +#include "app/ui/timeline/timeline.h" #include "app/util/freetype_utils.h" #include "base/bind.h" #include "base/fs.h" @@ -190,6 +191,12 @@ void PasteTextCommand::onExecute(Context* ctx) false, 0)); } + // TODO we don't support pasting text in multiple cels at the + // moment, so we clear the range here (same as in + // clipboard::paste()) + if (auto timeline = App::instance()->timeline()) + timeline->clearAndInvalidateRange(); + editor->pasteImage(image.get()); } } diff --git a/src/app/util/clipboard.cpp b/src/app/util/clipboard.cpp index 77ba57bae..cc64b75f9 100644 --- a/src/app/util/clipboard.cpp +++ b/src/app/util/clipboard.cpp @@ -1,5 +1,5 @@ // Aseprite -// Copyright (C) 2019 Igara Studio S.A. +// Copyright (C) 2019-2020 Igara Studio S.A. // Copyright (C) 2001-2018 David Capello // // This program is distributed under the terms of @@ -396,8 +396,9 @@ void paste(Context* ctx, const bool interactive) } if (current_editor && interactive) { - // TODO we don't support pasting in multiple cels at the moment, - // so we clear the range here. + // TODO we don't support pasting in multiple cels at the + // moment, so we clear the range here (same as in + // PasteTextCommand::onExecute()) App::instance()->timeline()->clearAndInvalidateRange(); // Change to MovingPixelsState