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:
@@ -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};
|
||||
|
||||
Reference in New Issue
Block a user