From: <wel...@us...> - 2011-02-05 17:41:41
|
Revision: 6860 http://planeshift.svn.sourceforge.net/planeshift/?rev=6860&view=rev Author: weltall2 Date: 2011-02-05 17:41:35 +0000 (Sat, 05 Feb 2011) Log Message: ----------- fixed text rendering when spellchecking of words bigger than the size of the textbox Modified Paths: -------------- trunk/src/client/gui/chatwindow.cpp Modified: trunk/src/client/gui/chatwindow.cpp =================================================================== --- trunk/src/client/gui/chatwindow.cpp 2011-02-05 17:08:26 UTC (rev 6859) +++ trunk/src/client/gui/chatwindow.cpp 2011-02-05 17:41:35 UTC (rev 6860) @@ -2667,6 +2667,7 @@ // Make the text the correct length csString tmp ( text.GetData() + start ); tmp.Truncate( maxChars ); + if (password) //show astrices instead of text for (unsigned int i=0;i<tmp.Length();i++) tmp.SetAt(i,'*'); @@ -2696,8 +2697,9 @@ wordStart=words[i-1].endPos - start; } int wordEnd = words[i].endPos - start; + // is the word or parts of it displayed? - if (!(((wordStart < 0) && (wordEnd < 0)) || ((wordStart >= tmp.Length()) && (wordEnd >= tmp.Length())))) + if (!(((wordStart < 0) && (wordEnd < 0)) || ((wordStart >= (int) tmp.Length()) && (wordEnd >= tmp.Length())))) { // set correct word borders according to displayed chars if (wordStart < 0) @@ -2716,10 +2718,12 @@ else { SetColour(typoColour); - } + } + DrawWidgetText( tmp.Slice(wordStart, wordEnd-wordStart).GetData(), textXPos, - screenFrame.ymin + textCenterY + margin); + screenFrame.ymin + textCenterY + margin); + // get the x-offest for the next word int textWidth, textHeight; GetFont()->GetDimensions( tmp.Slice(wordStart, wordEnd-wordStart).GetData(), textWidth, textHeight ); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |