mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-26 04:35:41 +03: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
Notes:
sideshowbarker
2024-07-17 03:00:02 +09:00
Author: https://github.com/AtkinsSJ Commit: https://github.com/SerenityOS/serenity/commit/9d2027de6b Pull-request: https://github.com/SerenityOS/serenity/pull/20105 Reviewed-by: https://github.com/linusg
@ -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 New Issue
Block a user