mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-01 18:00:26 +00:00
Remove the marching ants effect from Timeline after paste
This is a simple fix for a recurrent problem where users don't know how to remove/deselect the copied selection from the timeline after pressing Ctrl+C. Generally the solution is pressing the Escape key, but just pasting with Ctrl+V in some destination will disable the effect now (just like spreadsheet apps work). Related to: https://community.aseprite.org/t/3941 https://community.aseprite.org/t/5038 https://community.aseprite.org/t/17281 https://github.com/aseprite/aseprite/issues/1498
This commit is contained in:
parent
637632eafb
commit
668a3d8159
@ -2073,12 +2073,11 @@ void Timeline::drawClipboardRange(ui::Graphics* g)
|
||||
&clipboard_document,
|
||||
&clipboard_range);
|
||||
|
||||
if (!m_document || clipboard_document != m_document)
|
||||
if (!m_document ||
|
||||
clipboard_document != m_document ||
|
||||
!m_clipboard_timer.isRunning())
|
||||
return;
|
||||
|
||||
if (!m_clipboard_timer.isRunning())
|
||||
m_clipboard_timer.start();
|
||||
|
||||
IntersectClip clip(g, getRangeClipBounds(clipboard_range));
|
||||
if (clip) {
|
||||
ui::Paint paint;
|
||||
@ -4272,6 +4271,14 @@ bool Timeline::onPaste(Context* ctx)
|
||||
{
|
||||
auto clipboard = ctx->clipboard();
|
||||
if (clipboard->format() == ClipboardFormat::DocRange) {
|
||||
// After a paste action, we just remove the marching ant
|
||||
// (following paste commands will paste the same source range, but
|
||||
// we just disable the marching ants effect).
|
||||
if (m_clipboard_timer.isRunning()) {
|
||||
m_clipboard_timer.stop();
|
||||
m_redrawMarchingAntsOnly = false;
|
||||
invalidate();
|
||||
}
|
||||
clipboard->paste(ctx, true);
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user