SCI/newgui: Do textcodeprocessing only for SCI1.1+
svn-id: r45126
This commit is contained in:
parent
fe7b70a4d5
commit
21d397fdd2
1 changed files with 14 additions and 10 deletions
|
@ -387,8 +387,10 @@ int16 SciGuiGfx::GetLongest(const char *text, int16 maxWidth, GuiResourceId orgF
|
||||||
curChar = *text++;
|
curChar = *text++;
|
||||||
switch (curChar) {
|
switch (curChar) {
|
||||||
case 0x7C:
|
case 0x7C:
|
||||||
curCharCount++;
|
if (getSciVersion() >= SCI_VERSION_1_1) {
|
||||||
curCharCount += TextCodeProcessing(text, orgFontId, oldPenColor);
|
curCharCount++;
|
||||||
|
curCharCount += TextCodeProcessing(text, orgFontId, oldPenColor);
|
||||||
|
}
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
case 0xD:
|
case 0xD:
|
||||||
|
@ -427,13 +429,15 @@ void SciGuiGfx::TextWidth(const char *text, int16 from, int16 len, GuiResourceId
|
||||||
while (len--) {
|
while (len--) {
|
||||||
curChar = *text++;
|
curChar = *text++;
|
||||||
switch (curChar) {
|
switch (curChar) {
|
||||||
case 0x7C:
|
|
||||||
len -= TextCodeProcessing(text, orgFontId, 0);
|
|
||||||
break;
|
|
||||||
case 0x0A:
|
case 0x0A:
|
||||||
case 0x0D:
|
case 0x0D:
|
||||||
textHeight = MAX<int16> (textHeight, _curPort->fontHeight);
|
textHeight = MAX<int16> (textHeight, _curPort->fontHeight);
|
||||||
break;
|
break;
|
||||||
|
case 0x7C:
|
||||||
|
if (getSciVersion() >= SCI_VERSION_1_1) {
|
||||||
|
len -= TextCodeProcessing(text, orgFontId, 0);
|
||||||
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
textHeight = MAX<int16> (textHeight, _curPort->fontHeight);
|
textHeight = MAX<int16> (textHeight, _curPort->fontHeight);
|
||||||
textWidth += _font->getCharWidth(curChar);
|
textWidth += _font->getCharWidth(curChar);
|
||||||
|
@ -505,15 +509,15 @@ void SciGuiGfx::DrawText(const char *text, int16 from, int16 len, GuiResourceId
|
||||||
while (len--) {
|
while (len--) {
|
||||||
curChar = (*text++);
|
curChar = (*text++);
|
||||||
switch (curChar) {
|
switch (curChar) {
|
||||||
case 0x7C:
|
|
||||||
len -= TextCodeProcessing(text, orgFontId, orgPenColor);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 0x0A:
|
case 0x0A:
|
||||||
case 0x0D:
|
case 0x0D:
|
||||||
case 0:
|
case 0:
|
||||||
break;
|
break;
|
||||||
|
case 0x7C:
|
||||||
|
if (getSciVersion() >= SCI_VERSION_1_1) {
|
||||||
|
len -= TextCodeProcessing(text, orgFontId, orgPenColor);
|
||||||
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
charWidth = _font->getCharWidth(curChar);
|
charWidth = _font->getCharWidth(curChar);
|
||||||
// clear char
|
// clear char
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue