From 1b5dd62b71d8d9b657b0cd7c138c9dc523a07cc4 Mon Sep 17 00:00:00 2001 From: Neil Date: Wed, 17 Mar 2021 14:58:11 +1100 Subject: Change Font to an interface and stop using FontID. Fonts are shared and reference counted using std::shared_ptr. This optimizes memory and reduces potential for allocation bugs. --- src/Editor.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Editor.cxx') diff --git a/src/Editor.cxx b/src/Editor.cxx index f9bf5a582..7fa790469 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -1829,7 +1829,7 @@ long Editor::TextWidth(uptr_t style, const char *text) { RefreshStyleData(); AutoSurface surface(this); if (surface) { - return std::lround(surface->WidthText(vs.styles[style].font, text)); + return std::lround(surface->WidthText(vs.styles[style].font.get(), text)); } else { return 1; } -- cgit v1.2.3