mirror of
https://github.com/AquariaOSE/Aquaria.git
synced 2025-02-10 06:04:03 +00:00
fix far off minimap symbols. broke in ce7239056
This commit is contained in:
parent
486541b1d7
commit
83ce096119
1 changed files with 12 additions and 13 deletions
|
@ -769,20 +769,19 @@ void MiniMapRender::renderIcon(MinimapIcon *ico, const Vector& pos)
|
||||||
return;
|
return;
|
||||||
Vector d = pos - dsq->game->avatar->position;
|
Vector d = pos - dsq->game->avatar->position;
|
||||||
const float len = d.getLength2D();
|
const float len = d.getLength2D();
|
||||||
float iconScale;
|
float iconScale = 1;
|
||||||
if (len < iconMaxOffset || !ico->scaleWithDistance)
|
if (len >= iconMaxOffset)
|
||||||
{
|
{
|
||||||
iconScale = 1;
|
d *= iconMaxOffset / len; // clamp to outer circle distance
|
||||||
}
|
if(ico->scaleWithDistance)
|
||||||
else
|
{
|
||||||
{
|
float k;
|
||||||
d *= iconMaxOffset / len;
|
if (len < iconMaxDistance)
|
||||||
float k;
|
k = ((iconMaxDistance - len) / (iconMaxDistance - iconMaxOffset));
|
||||||
if (len < iconMaxDistance)
|
else
|
||||||
k = ((iconMaxDistance - len) / (iconMaxDistance - iconMaxOffset));
|
k = 0;
|
||||||
else
|
iconScale = iconMinScale + k*(1-iconMinScale);
|
||||||
k = 0;
|
}
|
||||||
iconScale = iconMinScale + k*(1-iconMinScale);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ico->tex->apply();
|
ico->tex->apply();
|
||||||
|
|
Loading…
Add table
Reference in a new issue