|
|
|
@ -94,15 +94,15 @@ protected: |
|
|
|
|
vf2d adjustedShadowScale={shadowScale,shadowScale}; |
|
|
|
|
vf2d labelTextSize= |
|
|
|
|
proportional? |
|
|
|
|
vf2d(game->GetWrappedTextSizeProp(finalLabel,rect.size.x-4,adjustedScale)): |
|
|
|
|
vf2d(game->GetWrappedTextSize(finalLabel,rect.size.x-4,adjustedScale)); |
|
|
|
|
vf2d(game->GetWrappedTextSizeProp(finalLabel,rect.size.x-8,adjustedScale)): |
|
|
|
|
vf2d(game->GetWrappedTextSize(finalLabel,rect.size.x-8,adjustedScale)); |
|
|
|
|
|
|
|
|
|
if(fitToLabel){ |
|
|
|
|
labelTextSize= |
|
|
|
|
proportional? |
|
|
|
|
vf2d(game->GetTextSizeProp(finalLabel)*adjustedScale): |
|
|
|
|
vf2d(game->GetTextSize(finalLabel)*adjustedScale); |
|
|
|
|
float sizeRatio=(labelTextSize.x)/(rect.size.x-4); |
|
|
|
|
float sizeRatio=(labelTextSize.x)/(rect.size.x-8); |
|
|
|
|
if(sizeRatio>1){ |
|
|
|
|
adjustedScale.x/=sizeRatio; |
|
|
|
|
adjustedShadowScale.x/=sizeRatio; |
|
|
|
@ -113,7 +113,7 @@ protected: |
|
|
|
|
vf2d drawPos=vf2d{-1,0}+rect.middle()-vf2d{labelTextSize}/2; //Assume centered.
|
|
|
|
|
if(!centered){ |
|
|
|
|
if(rightAlign){ |
|
|
|
|
drawPos=vf2d{rect.pos.x+rect.size.x-labelTextSize.x-4,rect.middle().y-labelTextSize.y/2}; //We should at least vertically align here.
|
|
|
|
|
drawPos=vf2d{rect.pos.x+rect.size.x-labelTextSize.x-8,rect.middle().y-labelTextSize.y/2}; //We should at least vertically align here.
|
|
|
|
|
}else{ //Left Align
|
|
|
|
|
drawPos=vf2d{rect.pos.x+2,rect.middle().y-labelTextSize.y/2}; //We should at least vertically align here.
|
|
|
|
|
} |
|
|
|
@ -141,15 +141,15 @@ protected: |
|
|
|
|
}else{ |
|
|
|
|
if(shadow){ |
|
|
|
|
if(proportional){ |
|
|
|
|
window.DrawShadowStringPropDecal(drawPos,finalLabel,WHITE,BLACK,adjustedScale,adjustedShadowScale,fitToLabel?std::numeric_limits<float>::max():rect.size.x-4); |
|
|
|
|
window.DrawShadowStringPropDecal(drawPos,finalLabel,WHITE,BLACK,adjustedScale,adjustedShadowScale,fitToLabel?std::numeric_limits<float>::max():rect.size.x-8); |
|
|
|
|
}else{ |
|
|
|
|
window.DrawShadowStringDecal(drawPos,finalLabel,WHITE,BLACK,adjustedScale,adjustedShadowScale,fitToLabel?std::numeric_limits<float>::max():rect.size.x-4); |
|
|
|
|
window.DrawShadowStringDecal(drawPos,finalLabel,WHITE,BLACK,adjustedScale,adjustedShadowScale,fitToLabel?std::numeric_limits<float>::max():rect.size.x-8); |
|
|
|
|
} |
|
|
|
|
}else{ |
|
|
|
|
if(proportional){ |
|
|
|
|
window.DrawStringPropDecal(drawPos,finalLabel,WHITE,adjustedScale,fitToLabel?std::numeric_limits<float>::max():rect.size.x-4); |
|
|
|
|
window.DrawStringPropDecal(drawPos,finalLabel,WHITE,adjustedScale,fitToLabel?std::numeric_limits<float>::max():rect.size.x-8); |
|
|
|
|
}else{ |
|
|
|
|
window.DrawStringDecal(drawPos,finalLabel,WHITE,adjustedScale,fitToLabel?std::numeric_limits<float>::max():rect.size.x-4); |
|
|
|
|
window.DrawStringDecal(drawPos,finalLabel,WHITE,adjustedScale,fitToLabel?std::numeric_limits<float>::max():rect.size.x-8); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|