Fix possible assertion violation in text.

Fixes #31047.
This commit is contained in:
John Preston
2026-07-24 18:19:42 +04:00
parent 816bd7b677
commit 089b4ca9cb
5 changed files with 64 additions and 7 deletions
+5
View File
@@ -7,6 +7,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
*/
#include "tests/test_main.h"
#include "base/base_file_utilities.h"
#include "base/invoke_queued.h"
#include "base/integration.h"
#include "ui/effects/animations.h"
@@ -171,6 +172,10 @@ int main(int argc, char *argv[]) {
auto app = App(argc, argv);
app.installNativeEventFilter(&app);
#ifdef Q_OS_MAC
base::RegisterBundledResources(u"test_text.rcc"_q);
#endif // Q_OS_MAC
const auto ratio = app.devicePixelRatio();
const auto useRatio = std::clamp(qCeil(ratio), 1, 3);
style::SetDevicePixelRatio(useRatio);