mirror of
https://github.com/1dot13/source.git
synced 2026-09-09 14:46:05 +02:00
Fix: colouring selected entry wrote over lower boundary
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6511 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+5
-2
@@ -358,6 +358,7 @@ void
|
|||||||
DropDown::DrawSelectedCity()
|
DropDown::DrawSelectedCity()
|
||||||
{
|
{
|
||||||
UINT16 usPosY = musStartY_Drop;
|
UINT16 usPosY = musStartY_Drop;
|
||||||
|
UINT16 usMaxY = 0;
|
||||||
|
|
||||||
// make sure we dont go out of our array
|
// make sure we dont go out of our array
|
||||||
if( mFirstShownEntry+mNumDisplayedEntries > (UINT8)(mEntryVector.size() ) )
|
if( mFirstShownEntry+mNumDisplayedEntries > (UINT8)(mEntryVector.size() ) )
|
||||||
@@ -365,16 +366,18 @@ DropDown::DrawSelectedCity()
|
|||||||
|
|
||||||
for( UINT8 i = mFirstShownEntry; i < mFirstShownEntry+mNumDisplayedEntries; ++i)
|
for( UINT8 i = mFirstShownEntry; i < mFirstShownEntry+mNumDisplayedEntries; ++i)
|
||||||
{
|
{
|
||||||
|
usMaxY = min(usPosY+musFontHeight+2, musStartY_Drop + musAreaHeight - 4);
|
||||||
|
|
||||||
if ( i == mSelectedEntry )
|
if ( i == mSelectedEntry )
|
||||||
{
|
{
|
||||||
ColorFillVideoSurfaceArea( FRAME_BUFFER, musStartX_Drop+4, usPosY-2, musStartX_Drop+musWidth-4, usPosY+musFontHeight+2, mColorMarked );
|
ColorFillVideoSurfaceArea( FRAME_BUFFER, musStartX_Drop+4, usPosY-2, musStartX_Drop+musWidth-4, usMaxY, mColorMarked );
|
||||||
SetFontShadow(NO_SHADOW);
|
SetFontShadow(NO_SHADOW);
|
||||||
DrawTextToScreen( mEntryVector[i].second, musStartX_Drop+CITY_NAME_OFFSET, usPosY, 0, DEF_DROPDOWN_FONT, FONT_BLACK, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
|
DrawTextToScreen( mEntryVector[i].second, musStartX_Drop+CITY_NAME_OFFSET, usPosY, 0, DEF_DROPDOWN_FONT, FONT_BLACK, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
|
||||||
SetFontShadow(DEFAULT_SHADOW);
|
SetFontShadow(DEFAULT_SHADOW);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ColorFillVideoSurfaceArea( FRAME_BUFFER, musStartX_Drop+4, usPosY-2, musStartX_Drop+musWidth-4, usPosY+musFontHeight+2, Get16BPPColor( FROMRGB( 0, 0, 0 ) ) );
|
ColorFillVideoSurfaceArea( FRAME_BUFFER, musStartX_Drop+4, usPosY-2, musStartX_Drop+musWidth-4, usMaxY, Get16BPPColor( FROMRGB( 0, 0, 0 ) ) );
|
||||||
DrawTextToScreen( mEntryVector[i].second, musStartX_Drop+CITY_NAME_OFFSET, usPosY, 0, DEF_DROPDOWN_FONT, STATIC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
|
DrawTextToScreen( mEntryVector[i].second, musStartX_Drop+CITY_NAME_OFFSET, usPosY, 0, DEF_DROPDOWN_FONT, STATIC_TEXT_COLOR, FONT_MCOLOR_BLACK, FALSE, LEFT_JUSTIFIED );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user