diff --git a/uppsrc/CtrlCore/DrawTextWin32.cpp b/uppsrc/CtrlCore/DrawTextWin32.cpp index 46de19531..5b535213e 100644 --- a/uppsrc/CtrlCore/DrawTextWin32.cpp +++ b/uppsrc/CtrlCore/DrawTextWin32.cpp @@ -6,27 +6,19 @@ namespace Upp { #define LLOG(x) -HFONT GetWin32Font(Font fnt, int angle); +HFONT GetWin32Font(Font fnt, int angle); +extern StaticMutex sFontLock; void SystemDraw::DrawTextOp(int x, int y, int angle, const wchar *text, Font font, Color ink, int n, const int *dx) { Std(font); -/* while(n > 3000) { - DrawTextOp(x, y, angle, text, font, ink, 3000, dx); - if(dx) - for(int i = 0; i < 30000; i++) - x += *dx++; - else - x += GetTextSize(text, font, 3000).cx; - n -= 3000; - text += 3000; - }*/ GuiLock __; COLORREF cr = GetColor(ink); if(cr != lastTextColor) { LLOG("Setting text color: " << ink); ::SetTextColor(handle, lastTextColor = cr); } + Mutex::Lock ___(sFontLock); HGDIOBJ orgfont = ::SelectObject(handle, GetWin32Font(font, angle)); int ascent = font.Info().GetAscent(); if(angle) { diff --git a/uppsrc/Draw/Font.cpp b/uppsrc/Draw/Font.cpp index 13218e6ce..480c86ab6 100644 --- a/uppsrc/Draw/Font.cpp +++ b/uppsrc/Draw/Font.cpp @@ -4,7 +4,7 @@ namespace Upp { -static StaticMutex sFontLock; +StaticMutex sFontLock; bool Replace(Font fnt, int chr, Font& rfnt);