mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 05:08:13 +00:00
TextEditor: Prevent autoscroll looping over
When a text file has only 1 line with long text autoscroll to the top will no longer loop over and set the cursor to the end of the line.
This commit is contained in:
parent
55e103deb5
commit
fd9dbf1f20
1 changed files with 1 additions and 1 deletions
|
@ -203,7 +203,7 @@ TextPosition TextEditor::text_position_at_content_position(Gfx::IntPoint content
|
|||
switch (m_text_alignment) {
|
||||
case Gfx::TextAlignment::CenterLeft:
|
||||
for_each_visual_line(line_index, [&](Gfx::IntRect const& rect, auto& view, size_t start_of_line, [[maybe_unused]] bool is_last_visual_line) {
|
||||
if (is_multi_line() && !rect.contains_vertically(position.y()) && !is_last_visual_line)
|
||||
if (is_multi_line() && !rect.contains_vertically(position.y()) && !is_last_visual_line && position.y() >= 0)
|
||||
return IterationDecision::Continue;
|
||||
|
||||
column_index = start_of_line;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue