mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-08-05 03:14:28 +00:00
Use base::SafeRound instead of std::round.
Previous assertion violations because of NaN from std::round were in video streaming, see commits27d58ba07b,8f5830d520. Now the crashes happened in the ConvertScale() call from a background thread when preparing an image from clipboard for sending to a chat.
This commit is contained in:
@@ -44,11 +44,11 @@ void PaintSavedMessagesInner(
|
||||
// X XX XX X | |
|
||||
// XX XX --- ---
|
||||
|
||||
const auto thinkness = std::round(size * 0.055);
|
||||
const auto thinkness = base::SafeRound(size * 0.055);
|
||||
const auto increment = int(thinkness) % 2 + (size % 2);
|
||||
const auto width = std::round(size * 0.15) * 2 + increment;
|
||||
const auto height = std::round(size * 0.19) * 2 + increment;
|
||||
const auto add = std::round(size * 0.064);
|
||||
const auto width = base::SafeRound(size * 0.15) * 2 + increment;
|
||||
const auto height = base::SafeRound(size * 0.19) * 2 + increment;
|
||||
const auto add = base::SafeRound(size * 0.064);
|
||||
|
||||
const auto left = x + (size - width) / 2;
|
||||
const auto top = y + (size - height) / 2;
|
||||
|
||||
Reference in New Issue
Block a user