improve performance when modifying text
This commit is contained in:
parent
91a3ed6a87
commit
9a739d7cb4
1 changed files with 2 additions and 2 deletions
|
@ -22,9 +22,9 @@ void Widget::fit_text(std::string &text) {
|
||||||
return;
|
return;
|
||||||
|
|
||||||
auto size = window()->painter().compute_text_size(rect(), text, style()->font_description());
|
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)) {
|
if (!resize(size)) {
|
||||||
reflow();
|
repaint();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue