diff options
| author | Neil <nyamatongwe@gmail.com> | 2020-06-10 13:00:05 +1000 |
|---|---|---|
| committer | Neil <nyamatongwe@gmail.com> | 2020-06-10 13:00:05 +1000 |
| commit | b50d82d5dd2c07da8064c4accbedb523a51b500d (patch) | |
| tree | e6889d04df874025c54e43ed08ab9cdcf56f2c4c /src/Editor.cxx | |
| parent | c6f1f1c7c7f486fd19c394a7e33df9f0980b55c8 (diff) | |
| download | scintilla-mirror-b50d82d5dd2c07da8064c4accbedb523a51b500d.tar.gz | |
Backport: Feature [feature-requests:1355]. Round instead of truncating for SCI_TEXTWIDTH.
Backport of changeset 8297:3665e2c20cd4.
Diffstat (limited to 'src/Editor.cxx')
| -rw-r--r-- | src/Editor.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx index c1bc8d435..e655b7e82 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -1819,11 +1819,11 @@ Sci::Position Editor::FormatRange(bool draw, const Sci_RangeToFormat *pfr) { return view.FormatRange(draw, pfr, surface, surfaceMeasure, *this, vs); } -int Editor::TextWidth(int style, const char *text) { +long Editor::TextWidth(uptr_t style, const char *text) { RefreshStyleData(); AutoSurface surface(this); if (surface) { - return static_cast<int>(surface->WidthText(vs.styles[style].font, text, static_cast<int>(strlen(text)))); + return Sci::lround(surface->WidthText(vs.styles[style].font, text, static_cast<int>(strlen(text)))); } else { return 1; } |
