Skip to content
Commit 02a76278 authored by Waqar Ahmed's avatar Waqar Ahmed
Browse files

Optimize rendering spaces with dyn wrapping

When dynamic wrapping is enabled and a QTextLine has trailing spaces, then
those spaces aren't really shown unless QTextOption::ShowTabsAndSpaces is
enabled. Thus we shouldn't waste time rendering spaces at the same
position.

With this commit, rendering of spaces is split into 3 steps:
1. Collect all spaces in the line by iterating over the text in reverse
2. Iterate over all the collected spaces in reverse because we want to
   look at the spaces in the beginning of line first and convert each
   space position into a QPointF. Whenever we encounter a point which
   was equal to the last collected point, we stop the loop and break.
3. Render all the collected space points at once.

BUG: 465841
parent 60f39534
Pipeline #343971 passed with stage
in 9 minutes and 39 seconds
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment