17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-09 10:12:24 +01:00

fix: the bugs and vulnerabilities SonarCloud reports on PR #216

This commit is contained in:
2026-11-07 22:11:08 +01:00
parent 8e85def98f
commit 7667e5b2ec
65 changed files with 910 additions and 121 deletions

View File

@@ -467,13 +467,19 @@ void editor_mode::draw_track_labels() const
std::vector<std::pair<ImVec2, ImVec2>> taken;
auto const tracks_under = [&](ImVec2 const &From, ImVec2 const &To) {
int count{0};
for (auto y = From.y; y <= To.y + cell * 0.5f; y += cell)
for (auto x = From.x; x <= To.x + cell * 0.5f; x += cell)
auto y = From.y;
while (y <= To.y + cell * 0.5f)
{
auto x = From.x;
while (x <= To.x + cell * 0.5f)
{
int column, row;
if (cell_of(std::min(x, To.x), std::min(y, To.y), column, row))
count += covered[static_cast<std::size_t>(row) * columns + column];
x += cell;
}
y += cell;
}
return count;
};
float constexpr kRings[]{0.0f, 26.0f, 42.0f, 62.0f, 86.0f, 116.0f, 150.0f};