Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1439,6 +1439,7 @@ int main(void)

float m_size_2d = 24.0f * cfg.ui_scale / Camera2DParams.zoom;
float m_text_2d = 16.0f * cfg.ui_scale / Camera2DParams.zoom;
float m_spacing_2d = cfg.ui_scale / Camera2DParams.zoom;
float mark_size_2d = 32.0f * cfg.ui_scale / Camera2DParams.zoom;

/* 2d projection rendering */
Expand Down Expand Up @@ -1634,7 +1635,7 @@ int main(void)

if (is_hl && Camera2DParams.zoom > 0.1f)
{
DrawUIText(customFont, satellites[i].name, sat_mx + (offset_i * map_w) + (m_size_2d / 2.f) + 4.f, sat_my - (m_size_2d / 2.f), m_text_2d, sCol);
DrawTextEx(customFont, satellites[i].name, (Vector2){sat_mx + (offset_i * map_w) + (m_size_2d / 2.f) + 4.f / Camera2DParams.zoom, sat_my - (m_size_2d / 2.f)}, m_text_2d, m_spacing_2d, sCol);
}
}
}
Expand All @@ -1652,7 +1653,7 @@ int main(void)

if (Camera2DParams.zoom > 0.1f)
{
DrawUIText(customFont, home_location.name, hx + x_off + (m_size_2d / 2.f) + 4.f, hy - (m_size_2d / 2.f), m_text_2d, WHITE);
DrawTextEx(customFont, home_location.name, (Vector2){hx + x_off + (m_size_2d / 2.f) + 4.0f / Camera2DParams.zoom, hy - (m_size_2d / 2.f)}, m_text_2d, m_spacing_2d, WHITE);
}
}

Expand Down Expand Up @@ -1681,13 +1682,13 @@ int main(void)
Vector2 mid = {(p1.x + p2.x) / 2.0f, (p1.y + p2.y) / 2.0f};
char rng_str[32];
TextCopy(rng_str, TextFormat("%.1f km", range));
Vector2 tSize = MeasureTextEx(customFont, rng_str, m_text_2d, 1.0f);
Vector2 tSize = MeasureTextEx(customFont, rng_str, m_text_2d, m_spacing_2d);

DrawRectangle(
mid.x - tSize.x / 2.0f - 2.0f / Camera2DParams.zoom, mid.y - tSize.y / 2.0f - 2.0f / Camera2DParams.zoom, tSize.x + 4.0f / Camera2DParams.zoom,
tSize.y + 4.0f / Camera2DParams.zoom, ApplyAlpha(cfg.ui_bg, 0.7f)
);
DrawUIText(customFont, rng_str, mid.x - tSize.x / 2.0f, mid.y - tSize.y / 2.0f, m_text_2d, cfg.ui_accent);
DrawTextEx(customFont, rng_str, (Vector2){mid.x - tSize.x / 2.0f, mid.y - tSize.y / 2.0f}, m_text_2d, m_spacing_2d, cfg.ui_accent);
}
}
}
Expand All @@ -1708,7 +1709,7 @@ int main(void)

if (Camera2DParams.zoom > 0.1f)
{
DrawUIText(customFont, markers[m].name, mx + x_off + (m_size_2d / 2.f) + 4.f, my - (m_size_2d / 2.f), m_text_2d, WHITE);
DrawTextEx(customFont, markers[m].name, (Vector2){mx + x_off + (m_size_2d / 2.f) + 4.f / Camera2DParams.zoom, my - (m_size_2d / 2.f)}, m_text_2d, m_spacing_2d, WHITE);
}
}
}
Expand Down
Loading