[Scummvm-cvs-logs] SF.net SVN: scummvm:[48797] scummvm/trunk/engines/sci/graphics/controls.cpp
m_kiewitz at users.sourceforge.net
m_kiewitz at users.sourceforge.net
Sun Apr 25 18:47:14 CEST 2010
Revision: 48797
http://scummvm.svn.sourceforge.net/scummvm/?rev=48797&view=rev
Author: m_kiewitz
Date: 2010-04-25 16:47:14 +0000 (Sun, 25 Apr 2010)
Log Message:
-----------
SCI: changing setFont() call logic inside textedit controls to save 2 setFont() calls
Modified Paths:
--------------
scummvm/trunk/engines/sci/graphics/controls.cpp
Modified: scummvm/trunk/engines/sci/graphics/controls.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/controls.cpp 2010-04-25 16:43:16 UTC (rev 48796)
+++ scummvm/trunk/engines/sci/graphics/controls.cpp 2010-04-25 16:47:14 UTC (rev 48797)
@@ -210,11 +210,11 @@
GuiResourceId fontId = GET_SEL32V(_segMan, controlObject, SELECTOR(font));
rect = Common::Rect(GET_SEL32V(_segMan, controlObject, SELECTOR(nsLeft)), GET_SEL32V(_segMan, controlObject, SELECTOR(nsTop)),
GET_SEL32V(_segMan, controlObject, SELECTOR(nsRight)), GET_SEL32V(_segMan, controlObject, SELECTOR(nsBottom)));
+ _text16->SetFont(fontId);
if (textAddChar) {
// We check, if we are really able to add the new char
uint16 textWidth = 0;
const char *textPtr = text.c_str();
- _text16->SetFont(fontId);
while (*textPtr)
textWidth += _text16->_font->getCharWidth(*textPtr++);
textWidth += _text16->_font->getCharWidth(eventKey);
@@ -226,9 +226,8 @@
}
texteditCursorErase();
_paint16->eraseRect(rect);
- _text16->Box(text.c_str(), 0, rect, SCI_TEXT16_ALIGNMENT_LEFT, fontId);
+ _text16->Box(text.c_str(), 0, rect, SCI_TEXT16_ALIGNMENT_LEFT, -1);
_paint16->bitsShow(rect);
- _text16->SetFont(fontId);
texteditCursorDraw(rect, text.c_str(), cursorPos);
_text16->SetFont(oldFontId);
// Write back string
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list