Merge pull request #16 from pietro1991-dot/devin/1781680179-panel-fallback
Co-authored-by: Pietro Giacobazzi <giacobazzipietro@gmail.com> Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
commit
fe7af9b8e0
@@ -444,8 +444,11 @@ int OnCalculate(const int rates_total,
|
|||||||
int TxtW(string s,int fs,bool bold)
|
int TxtW(string s,int fs,bool bold)
|
||||||
{
|
{
|
||||||
TextSetFont(bold?"Consolas Bold":"Consolas",-fs*10);
|
TextSetFont(bold?"Consolas Bold":"Consolas",-fs*10);
|
||||||
uint w=0,h=0; TextGetSize(s,w,h);
|
uint w=0,h=0;
|
||||||
return (int)w;
|
bool ok=TextGetSize(s,w,h);
|
||||||
|
int est=(int)MathCeil(StringLen(s)*fs*0.62); // fallback se TextGetSize non disponibile
|
||||||
|
if(!ok || (int)w<=0) return est;
|
||||||
|
return MathMax((int)w,est); // mai meno della stima
|
||||||
}
|
}
|
||||||
//+------------------------------------------------------------------+
|
//+------------------------------------------------------------------+
|
||||||
void DrawInfo()
|
void DrawInfo()
|
||||||
|
|||||||
Reference in New Issue
Block a user