17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-17 02:49:19 +02:00

fix(editor): no variables named near or far, the Windows headers define them away

This commit is contained in:
maj00r
2026-10-06 22:37:00 +02:00
parent 24923dd472
commit d4271ea7c5
4 changed files with 19 additions and 19 deletions

View File

@@ -395,19 +395,19 @@ std::vector<sweep_node *> editor_mode::sweeps_near(TTrack const &Track) const
if (sweep == nullptr || sweep->m_editorremoved)
continue;
auto const &definition{sweep->definition()};
bool near{false};
bool close{false};
for (auto const &piece : definition.pieces)
{
bezier const curve{piece};
for (int k = 0; k <= 8 && false == near; ++k)
for (int k = 0; k <= 8 && false == close; ++k)
{
auto const point{curve.point(k / 8.0)};
near = std::any_of(points.begin(), points.end(), [&](glm::dvec3 const &Other) { return plan_distance(point, Other) < kSweepNear; });
close = std::any_of(points.begin(), points.end(), [&](glm::dvec3 const &Other) { return plan_distance(point, Other) < kSweepNear; });
}
if (near)
if (close)
break;
}
if (near)
if (close)
result.push_back(sweep);
}
return result;
@@ -628,11 +628,11 @@ void editor_mode::render_sweep_ui()
// models along curves by this line
if (track != nullptr)
{
auto const near{sweeps_near(*track)};
if (false == near.empty())
auto const alongside{sweeps_near(*track)};
if (false == alongside.empty())
{
ImGui::TextDisabled("%s", STR_C("By this track:"));
for (auto *sweep : near)
for (auto *sweep : alongside)
{
ImGui::PushID(sweep);
auto const &definition{sweep->definition()};