From 858b5831e88ecf7a21a075622d800755e6524b05 Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Wed, 10 Mar 2021 14:47:59 +0300 Subject: [PATCH] Fixed clearing of redo list after adding sticker item in photo editor. --- Telegram/SourceFiles/editor/editor_paint.cpp | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/Telegram/SourceFiles/editor/editor_paint.cpp b/Telegram/SourceFiles/editor/editor_paint.cpp index 9c0fb6854..459d3dca0 100644 --- a/Telegram/SourceFiles/editor/editor_paint.cpp +++ b/Telegram/SourceFiles/editor/editor_paint.cpp @@ -57,12 +57,6 @@ Paint::Paint( _view->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); _view->setStyleSheet(kViewStyle.utf8()); - _scene->mousePresses( - ) | rpl::start_with_next([=] { - _hasUndo = true; - clearRedoList(); - }, lifetime()); - _scene->addsItem( ) | rpl::start_with_next([=] { updateUndoState(); @@ -126,6 +120,17 @@ Paint::Paint( _scene->clearSelection(); }, lifetime()); } + + rpl::merge( + controllers->stickersPanelController + ? controllers->stickersPanelController->stickerChosen( + ) | rpl::to_empty + : rpl::never<>(), + _scene->mousePresses() + ) | rpl::start_with_next([=] { + _hasUndo = true; + clearRedoList(); + }, lifetime()); } void Paint::applyTransform(QRect geometry, int angle, bool flipped) {