diff options
| author | Neil <nyamatongwe@gmail.com> | 2015-11-11 19:14:30 +1100 |
|---|---|---|
| committer | Neil <nyamatongwe@gmail.com> | 2015-11-11 19:14:30 +1100 |
| commit | 23460f666bf34479850000eed40ba0ea38ca6665 (patch) | |
| tree | 1c199ed2a3adb52f3cb6790b39532235e66e38f2 /cocoa | |
| parent | 3684fe443af3fcc0e5ad8ab674203a58c4ccaac3 (diff) | |
| download | scintilla-mirror-23460f666bf34479850000eed40ba0ea38ca6665.tar.gz | |
Implemented idle styling. This allows painting without first styling all visible
text then styling in the background using idle-time.
Diffstat (limited to 'cocoa')
| -rw-r--r-- | cocoa/ScintillaCocoa.mm | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/cocoa/ScintillaCocoa.mm b/cocoa/ScintillaCocoa.mm index 8b95aae0e..982ca0423 100644 --- a/cocoa/ScintillaCocoa.mm +++ b/cocoa/ScintillaCocoa.mm @@ -1801,13 +1801,15 @@ void ScintillaCocoa::WillDraw(NSRect rect) { RefreshStyleData(); PRectangle rcWillDraw = NSRectToPRectangle(rect); - int positionAfterRect = PositionAfterArea(rcWillDraw); - pdoc->EnsureStyledTo(positionAfterRect); + const int posAfterArea = PositionAfterArea(rcWillDraw); + const int posAfterMax = PositionAfterMaxStyling(posAfterArea, true); + pdoc->StyleToAdjustingLineDuration(posAfterMax); + StartIdleStyling(posAfterMax < posAfterArea); NotifyUpdateUI(); if (WrapLines(wsVisible)) { // Wrap may have reduced number of lines so more lines may need to be styled - positionAfterRect = PositionAfterArea(rcWillDraw); - pdoc->EnsureStyledTo(positionAfterRect); + const int posAfterAreaWrapped = PositionAfterArea(rcWillDraw); + pdoc->EnsureStyledTo(posAfterAreaWrapped); // The wrapping process has changed the height of some lines so redraw all. Redraw(); } |
