set pointSize, underline, font, before calculate_layout early return

This commit is contained in:
2025-02-09 11:28:29 -06:00
parent c079d0f5a9
commit 81114d0202

View File

@@ -130,14 +130,13 @@ void cTextMsg::calculate_layout() {
} }
void cTextMsg::recalcRect() { void cTextMsg::recalcRect() {
style.pointSize = textSize;
style.underline = underlined;
style.font = textFont;
if(fixedWidth && fixedHeight){ if(fixedWidth && fixedHeight){
calculate_layout(); calculate_layout();
return; return;
} }
TextStyle style;
style.font = textFont;
style.pointSize = textSize;
style.underline = underlined;
style.lineHeight = textSize + 2; style.lineHeight = textSize + 2;
std::string test = getText(); std::string test = getText();
size_t lines = 1, cur_line_chars = 0, max_line_chars = 0; size_t lines = 1, cur_line_chars = 0, max_line_chars = 0;