summaryrefslogtreecommitdiff
path: root/Libraries/LibWeb/Layout
diff options
context:
space:
mode:
authorZac <zacary.gillerat@connect.qut.edu.au>2020-11-13 15:29:55 +1000
committerAndreas Kling <kling@serenityos.org>2020-11-19 21:59:13 +0100
commit6a569bbdd76a23d0875fa06c10e4ddb5838b0259 (patch)
treed1be050bec229e311ec7bf7ebcebbf1846ee096a /Libraries/LibWeb/Layout
parentf72f4c5bcad207c6f3436bb6640422e6853f3b68 (diff)
downloadserenity-6a569bbdd76a23d0875fa06c10e4ddb5838b0259.zip
TextEditor: Change cursor behaviour when clicking empty space
When clicking empty space (beneath any used lines) in the TextEditor, the cursor would jump to the start of the last line, rather than the correct column, or the end of the line where appropriate. This was because in the for_each_visual_line callback would return IterationDecision::Continue if the clicked point wasn't in the line's rect. Thus the callback would continue on each iteration and at the end, would set the cursor to the default column of 0. To fix this I added a bool to the callback's signature which tells the callback if the for_each_visual_line method is on the last visual line. The callback now does not return IterationDecision:Continue if for_each_visual_line method is on the last line and the correct column is then calculated with the line passed.
Diffstat (limited to 'Libraries/LibWeb/Layout')
0 files changed, 0 insertions, 0 deletions