diff options
author | Neil Hodgson <nyamatongwe@gmail.com> | 2014-06-07 09:22:37 +1000 |
---|---|---|
committer | Neil Hodgson <nyamatongwe@gmail.com> | 2014-06-07 09:22:37 +1000 |
commit | 546b89b1c20dc25d8013f92c7a2053e940483fec (patch) | |
tree | 75d5feac6423f812f93ffbc5883bc990aed82d1a | |
parent | 982541f99d2e9e143c0da043266efb9ae5f9640b (diff) | |
download | scintilla-mirror-546b89b1c20dc25d8013f92c7a2053e940483fec.tar.gz |
Fix laying out of emoji. Emoji are not in the BMP, taking 2 UTF-16 code units. Previously the
position used was that reported after the first code unit (0) instead of that after both code units.
This led to the character after the emoji sharing space with it.
-rw-r--r-- | cocoa/PlatCocoa.mm | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/cocoa/PlatCocoa.mm b/cocoa/PlatCocoa.mm index 2225631a6..28fe4dd8b 100644 --- a/cocoa/PlatCocoa.mm +++ b/cocoa/PlatCocoa.mm @@ -957,7 +957,7 @@ void SurfaceImpl::MeasureWidths(Font &font_, const char *s, int len, XYPOSITION while (ui<fit) { size_t lenChar = utf8LengthFromLead(us[i]); size_t codeUnits = (lenChar < 4) ? 1 : 2; - CGFloat xPosition = CTLineGetOffsetForStringIndex(mLine, ui+1, NULL); + CGFloat xPosition = CTLineGetOffsetForStringIndex(mLine, ui+codeUnits, NULL); for (unsigned int bytePos=0; (bytePos<lenChar) && (i<len); bytePos++) { positions[i++] = xPosition; } |