Fix pasting text on empty cel when the timeline range is enabled

Bug report: https://community.aseprite.org/t/4489
This commit is contained in:
David Capello 2020-01-30 19:47:23 -03:00
parent d5f0e3189c
commit 1bb126fade
2 changed files with 12 additions and 4 deletions

View File

@ -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());
}
}

View File

@ -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