improve performance when modifying text

This commit is contained in:
hippoz 2022-06-15 04:45:12 +03:00
parent 91a3ed6a87
commit 9a739d7cb4
No known key found for this signature in database
GPG key ID: 7C52899193467641

View file

@ -22,9 +22,9 @@ void Widget::fit_text(std::string &text) {
return;
auto size = window()->painter().compute_text_size(rect(), text, style()->font_description());
// always reflow, even if resize doesn't
// always repaint, even if resize doesn't reflow
if (!resize(size)) {
reflow();
repaint();
}
}