mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 06:07:06 +02:00
Fixed infinite attempts to draw foreground in userpic builder.
This commit is contained in:
parent
1ee53ee0c1
commit
e29c6d2f23
1 changed files with 4 additions and 1 deletions
|
@ -185,11 +185,14 @@ void EmojiUserpic::result(int size, Fn<void(UserpicBuilder::Result)> done) {
|
|||
auto background = GenerateGradient(Size(size), _colors, false);
|
||||
|
||||
{
|
||||
constexpr auto kAttemptsToDrawFirstFrame = 3000;
|
||||
auto attempts = 0;
|
||||
auto p = QPainter(&background);
|
||||
while (true) {
|
||||
while (attempts < kAttemptsToDrawFirstFrame) {
|
||||
if (painter->paintForeground(p)) {
|
||||
break;
|
||||
}
|
||||
attempts++;
|
||||
}
|
||||
}
|
||||
if (*_playOnce && document) {
|
||||
|
|
Loading…
Add table
Reference in a new issue