aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Editor.cxx6
-rw-r--r--src/Editor.h2
2 files changed, 4 insertions, 4 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx
index b7636adb2..234a2aaa6 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -1823,11 +1823,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));
+ return std::lround(surface->WidthText(vs.styles[style].font, text));
} else {
return 1;
}
@@ -6757,7 +6757,7 @@ sptr_t Editor::WndProc(unsigned int iMessage, uptr_t wParam, sptr_t lParam) {
case SCI_TEXTWIDTH:
PLATFORM_ASSERT(wParam < vs.styles.size());
PLATFORM_ASSERT(lParam);
- return TextWidth(static_cast<int>(wParam), CharPtrFromSPtr(lParam));
+ return TextWidth(wParam, CharPtrFromSPtr(lParam));
case SCI_TEXTHEIGHT:
RefreshStyleData();
diff --git a/src/Editor.h b/src/Editor.h
index 80203d319..dda14c311 100644
--- a/src/Editor.h
+++ b/src/Editor.h
@@ -388,7 +388,7 @@ protected: // ScintillaBase subclass needs access to much of Editor
void RefreshPixMaps(Surface *surfaceWindow);
void Paint(Surface *surfaceWindow, PRectangle rcArea);
Sci::Position FormatRange(bool draw, const Sci_RangeToFormat *pfr);
- int TextWidth(int style, const char *text);
+ long TextWidth(uptr_t style, const char *text);
virtual void SetVerticalScrollPos() = 0;
virtual void SetHorizontalScrollPos() = 0;