From f0e1f55ee44c69bae18fbccb7987491f710aa58b Mon Sep 17 00:00:00 2001 From: cxl Date: Sat, 16 Nov 2013 11:36:09 +0000 Subject: [PATCH] Draw: Fixed issue with very long texts in DrawText #572 git-svn-id: svn://ultimatepp.org/upp/trunk@6562 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/CtrlCore/DrawTextWin32.cpp | 12 ++++++------ uppsrc/Draw/DrawText.cpp | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/uppsrc/CtrlCore/DrawTextWin32.cpp b/uppsrc/CtrlCore/DrawTextWin32.cpp index 54c0ae565..e6ae4bc71 100644 --- a/uppsrc/CtrlCore/DrawTextWin32.cpp +++ b/uppsrc/CtrlCore/DrawTextWin32.cpp @@ -11,16 +11,16 @@ HFONT GetWin32Font(Font fnt, int angle); 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 > 30000) { - DrawTextOp(x, y, angle, text, font, ink, 30000, dx); +/* 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, 30000).cx; - n -= 30000; - text += 30000; - } + x += GetTextSize(text, font, 3000).cx; + n -= 3000; + text += 3000; + }*/ GuiLock __; COLORREF cr = GetColor(ink); if(cr != lastTextColor) { diff --git a/uppsrc/Draw/DrawText.cpp b/uppsrc/Draw/DrawText.cpp index 48ed80c30..cd8d112ac 100644 --- a/uppsrc/Draw/DrawText.cpp +++ b/uppsrc/Draw/DrawText.cpp @@ -57,7 +57,7 @@ void Draw::DrawText(int x, int y, int angle, const wchar *text, Font font, else { int c = 1; int dd = 0; - while(i + c < n) { + while(i + c < n && c < 1000) { GlyphInfo gi2 = GetGlyphInfo(font, text[i + c]); if(!gi2.IsNormal()) break;