Browse Source

Undo the kRenderJustXForceLeft bugfix of 4 commits back.

The fix (adding adjustment of fRenderInfo.fDestPtr) made kRenderJustXForceLeft behave as intended (left-aligning the edge of the bitmap rather than the side bearing of the first character) but cuts off shadows in some places (e.g. at the left edges of "BUDDIES" and "NEIGHBORS" in the mini KI). To ensure enough space for the shadow, and considering that all content was developed and visually optimized with the bug in place, it seems better to preserve the buggy behavior and make kRenderJustXForceLeft work exactly like kRenderJustXLeft.
Christian Walther 11 years ago
parent
commit
a0bbef1819
  1. 18
      MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plGImage/plFont.cpp

18
MOULOpenSourceClientPlugin/Plasma20/Sources/Plasma/PubUtilLib/plGImage/plFont.cpp

@ -679,16 +679,14 @@ void plFont::IRenderString( plMipmap *mip, UInt16 x, UInt16 y, const wchar_t *st
fRenderInfo.fRenderFunc = oldFunc; fRenderInfo.fRenderFunc = oldFunc;
} }
// Adjust for left kern // There used to be an adjustment of the X coordinate by -ch.fLeftKern for the case
if( ( fRenderInfo.fFlags & kRenderJustXMask ) == kRenderJustXForceLeft ) // of kRenderJustXForceLeft here, but it was buggy in that it neglected to adjust
{ // fRenderInfo.fDestPtr and therefore had no visible effect (or almost none - only
// See note at top of file // at the end of the line). Fixing the bug however (making kRenderJustXForceLeft
plCharacter &ch = fCharacters[ (UInt16)string[ 0 ] - fFirstChar ]; // work as intended) causes the text shadow to be cut off in some places. To ensure
fRenderInfo.fX -= (Int16)ch.fLeftKern; // enough space for the shadow, and considering that all content was developed and
fRenderInfo.fMaxWidth += (Int16)ch.fLeftKern; // visually optimized with the bug in place, it seems better to preserve the buggy
fRenderInfo.fDestPtr -= (Int16)ch.fLeftKern * fRenderInfo.fDestBPP; // behavior and make kRenderJustXForceLeft work exactly like kRenderJustXLeft.
fRenderInfo.fFarthestX = fRenderInfo.fX;
}
fRenderInfo.fVolatileStringPtr = string; // Just so we can keep track of when we clip fRenderInfo.fVolatileStringPtr = string; // Just so we can keep track of when we clip
IRenderLoop( string, -1 ); IRenderLoop( string, -1 );

Loading…
Cancel
Save