From: Jerome St-Louis Date: Thu, 4 Aug 2016 06:06:24 +0000 (-0400) Subject: extras/html: Fixed shaky text selection with new TextExtent2() X-Git-Tag: 0.44.15~29 X-Git-Url: https://ecere.com/cgi-bin/gitweb.cgi?p=sdk;a=commitdiff_plain;h=b01707339cdf135aeddf89956da4f25e6c9a67fb extras/html: Fixed shaky text selection with new TextExtent2() --- diff --git a/extras/html/lines.ec b/extras/html/lines.ec index 0274d14..7381e26 100644 --- a/extras/html/lines.ec +++ b/extras/html/lines.ec @@ -318,6 +318,7 @@ void RenderLine(HTMLView browser, Surface surface, int x, int y, int w, int h, B Block block = startBlock; int startSel, endSel; Block startSelBlock = null, endSelBlock = null; + int prevGlyph = 0; if(browser.textBlock != browser.selBlock || browser.curPosition != browser.selPosition) browser.NormalizeSelection(&startSelBlock, &startSel, &endSelBlock, &endSel); @@ -402,7 +403,7 @@ void RenderLine(HTMLView browser, Surface surface, int x, int y, int w, int h, B int l = startSel - textPos; if(block.text) { - surface.TextExtent(block.text + textPos, l, &tw, &th); + surface.TextExtent2(block.text + textPos, l, &tw, &th, prevGlyph, &prevGlyph, null); surface.WriteText(x, y + h - th, block.text + textPos, l); x += tw; } @@ -422,7 +423,7 @@ void RenderLine(HTMLView browser, Surface surface, int x, int y, int w, int h, B surface.foreground = white; surface.textOpacity = true; } - surface.TextExtent(block.text + textPos, len, &tw, &th); + surface.TextExtent2(block.text + textPos, len, &tw, &th, prevGlyph, &prevGlyph, null); surface.WriteText(x, y + h - th, block.text + textPos, len); x += tw; if(browser.isSelected) @@ -441,7 +442,7 @@ void RenderLine(HTMLView browser, Surface surface, int x, int y, int w, int h, B int l = endPos - textPos; if(block.text) { - surface.TextExtent(block.text + textPos, l, &tw, &th); + surface.TextExtent2(block.text + textPos, l, &tw, &th, prevGlyph, &prevGlyph, null); surface.WriteText(x, y + h - th, block.text + textPos, l); x += tw; }