17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-20 12:44:52 +02:00

fix(editor): a vertex the track runs straight through no longer crashes the fit of a shape

The ends' budget of a curve too big for its leg lowered the scale of both
vertices beside it, a straight one too, which has no tangents to ask:
with no transitions the empty function was called and threw
bad_function_call, with transitions the vertex got a false warning of a
reduced R. Straight vertices are left out of the scaling.
This commit is contained in:
maj00r
2026-10-19 19:31:36 +02:00
parent a311bd013f
commit 90ce10960e

View File

@@ -488,7 +488,7 @@ result fit_between(design const &Design)
}
for (std::size_t k = 0; k < count; ++k)
{
if (scales[k] >= 1.0)
if (scales[k] >= 1.0 || fits[k].tangents == nullptr)
continue;
auto &fit{fits[k]};
auto const budgetin{fit.tangent_in * scales[k]};