Ecere Software
/
sdk
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
ebdfd2a
)
extras/html: Fixed shaky text selection with new TextExtent2()
author
Jerome St-Louis
<jerome@ecere.com>
Thu, 4 Aug 2016 06:06:24 +0000
(
02:06
-0400)
committer
Jerome St-Louis
<jerome@ecere.com>
Thu, 4 Aug 2016 06:06:24 +0000
(
02:06
-0400)
extras/html/lines.ec
patch
|
blob
|
history
diff --git
a/extras/html/lines.ec
b/extras/html/lines.ec
index
0274d14
..
7381e26
100644
(file)
--- 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;
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);
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)
{
int l = startSel - textPos;
if(block.text)
{
- surface.TextExtent
(block.text + textPos, l, &tw, &th
);
+ surface.TextExtent
2(block.text + textPos, l, &tw, &th, prevGlyph, &prevGlyph, null
);
surface.WriteText(x, y + h - th, block.text + textPos, l);
x += tw;
}
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.foreground = white;
surface.textOpacity = true;
}
- surface.TextExtent
(block.text + textPos, len, &tw, &th
);
+ surface.TextExtent
2(block.text + textPos, len, &tw, &th, prevGlyph, &prevGlyph, null
);
surface.WriteText(x, y + h - th, block.text + textPos, len);
x += tw;
if(browser.isSelected)
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)
{
int l = endPos - textPos;
if(block.text)
{
- surface.TextExtent
(block.text + textPos, l, &tw, &th
);
+ surface.TextExtent
2(block.text + textPos, l, &tw, &th, prevGlyph, &prevGlyph, null
);
surface.WriteText(x, y + h - th, block.text + textPos, l);
x += tw;
}
surface.WriteText(x, y + h - th, block.text + textPos, l);
x += tw;
}