From ef61afe500f7ba58b1fcefaa1ab0205ccb66b5c2 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Fri, 13 May 2011 10:27:30 +1000 Subject: Break measurement of text into reasonable sized segments similar to drawing. Drawing will now always be broken up at a character boundary even when there is a large number of alphabetic characters. Fixes bug #3165743. --- src/Editor.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/Editor.cxx') diff --git a/src/Editor.cxx b/src/Editor.cxx index 03c7b1103..ae2d670ce 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -2185,7 +2185,7 @@ void Editor::LayoutLine(int line, Surface *surface, ViewStyle &vstyle, LineLayou } else { lastSegItalics = vstyle.styles[ll->styles[charInLine]].italic; posCache.MeasureWidths(surface, vstyle, ll->styles[charInLine], ll->chars + startseg, - lenSeg, ll->positions + startseg + 1); + lenSeg, ll->positions + startseg + 1, pdoc); } } } else { // invisible @@ -2801,7 +2801,7 @@ void Editor::DrawLine(Surface *surface, ViewStyle &vsDraw, int line, int lineVis ll->psel = &sel; - BreakFinder bfBack(ll, lineStart, lineEnd, posLineStart, IsUnicodeMode(), xStartVisible, selBackDrawn); + BreakFinder bfBack(ll, lineStart, lineEnd, posLineStart, xStartVisible, selBackDrawn, pdoc); int next = bfBack.First(); // Background drawing loop @@ -2891,8 +2891,8 @@ void Editor::DrawLine(Surface *surface, ViewStyle &vsDraw, int line, int lineVis inIndentation = subLine == 0; // Do not handle indentation except on first subline. // Foreground drawing loop - BreakFinder bfFore(ll, lineStart, lineEnd, posLineStart, IsUnicodeMode(), xStartVisible, - ((!twoPhaseDraw && selBackDrawn) || vsDraw.selforeset)); + BreakFinder bfFore(ll, lineStart, lineEnd, posLineStart, xStartVisible, + ((!twoPhaseDraw && selBackDrawn) || vsDraw.selforeset), pdoc); next = bfFore.First(); while (next < lineEnd) { -- cgit v1.2.3