mirror of
https://github.com/SerenityOS/serenity
synced 2024-07-23 11:04:40 +00:00
LibGUI: Make folded lines take up 0 vertical space in no-wrap mode
If a line is hidden by a folding region, then it needs to not take up any vertical space, or else we just get a glitchy blank line instead of a folded one. This change corrects the logic when wrapping is not enabled.
This commit is contained in:
parent
d832f3a887
commit
9d2027de6b
|
@ -2167,10 +2167,8 @@ void TextEditor::recompute_visual_lines(size_t line_index, Vector<TextDocumentFo
|
|||
}
|
||||
}
|
||||
|
||||
if (is_wrapping_enabled())
|
||||
visual_data->visual_rect = { m_horizontal_content_padding, 0, available_width, static_cast<int>(visual_data->visual_lines.size()) * line_height() };
|
||||
else
|
||||
visual_data->visual_rect = { m_horizontal_content_padding, 0, text_width_for_font(line.view(), font()), line_height() };
|
||||
auto line_width = is_wrapping_enabled() ? available_width : text_width_for_font(line.view(), font());
|
||||
visual_data->visual_rect = { m_horizontal_content_padding, 0, line_width, static_cast<int>(visual_data->visual_lines.size()) * line_height() };
|
||||
}
|
||||
|
||||
template<typename Callback>
|
||||
|
|
Loading…
Reference in a new issue