diff options
author | Neil <nyamatongwe@gmail.com> | 2021-03-30 19:34:53 +1100 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2021-03-30 19:34:53 +1100 |
commit | b5ba1cee2188ab879573126c62d6291b346e089c (patch) | |
tree | af65145d10a0b8a348a448a7bb4ded03f75a029a /src/LineMarker.cxx | |
parent | 3ca96902ea5d6d8a6b62d4abd6669d36b81377d1 (diff) | |
download | scintilla-mirror-b5ba1cee2188ab879573126c62d6291b346e089c.tar.gz |
Treat SC_MARK_CHARACTER as Unicode for a wider variety of symbols.
Diffstat (limited to 'src/LineMarker.cxx')
-rw-r--r-- | src/LineMarker.cxx | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/LineMarker.cxx b/src/LineMarker.cxx index 02228b6f5..ed9c1ce7a 100644 --- a/src/LineMarker.cxx +++ b/src/LineMarker.cxx @@ -26,6 +26,7 @@ #include "XPM.h" #include "LineMarker.h" +#include "UniConversion.h" using namespace Scintilla; @@ -530,12 +531,13 @@ void LineMarker::Draw(Surface *surface, const PRectangle &rcWhole, const Font *f default: if (markType >= SC_MARK_CHARACTER) { - std::string character(1, static_cast<char>(markType - SC_MARK_CHARACTER)); - const XYPOSITION width = surface->WidthText(fontForCharacter, character); + char character[UTF8MaxBytes + 1]; + UTF8FromUTF32Character(markType - SC_MARK_CHARACTER, character); + const XYPOSITION width = surface->WidthTextUTF8(fontForCharacter, character); PRectangle rcText = rc; rcText.left += (rc.Width() - width) / 2; - rcText.right = rc.left + width; - surface->DrawTextClipped(rcText, fontForCharacter, rcText.bottom - 2, + rcText.right = rcText.left + width; + surface->DrawTextNoClipUTF8(rcText, fontForCharacter, rcText.bottom - 2, character, fore, back); } else { // treat as SC_MARK_FULLRECT |