1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 08:45:09 +00:00

TextEditor: Removed unnecessary use of for_each

Didn't notice that m_visual_rect existed :P
This commit is contained in:
rhin123 2019-09-05 19:03:53 -05:00 committed by Andreas Kling
parent 8fc2034ca1
commit 1adec6d54b

View file

@ -107,11 +107,8 @@ void GTextEditor::update_content_size()
int content_width = 0;
int content_height = 0;
for (auto& line : m_lines) {
line.for_each_visual_line([&](const Rect& rect, const StringView&, int) {
content_width = max(rect.width(), content_width);
content_height += rect.height();
return IterationDecision::Continue;
});
content_width = max(line.m_visual_rect.width(), content_width);
content_height += line.m_visual_rect.height();
}
content_width += m_horizontal_content_padding * 2;
if (is_right_text_alignment(m_text_alignment))