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

hint parallel snap while shifting a straight

This commit is contained in:
maj00r
2026-10-08 21:59:36 +02:00
parent 4d7f5f0f0c
commit 7618dcda59
4 changed files with 103 additions and 14 deletions

View File

@@ -325,6 +325,16 @@ editor_mode::track_intent editor_mode::track_intent_at(int const Mods)
glm::dvec3 const handles[] = {line.start, line.end, (line.start + line.end) * 0.5};
intent.index = hit;
intent.position = handles[hit];
if (hit == 2)
{
auto const offer{straight_parallel_offer(line, {})};
if (offer.near)
{
intent.action = format(offer.snaps ? STR_C("Drag: shift the straight sideways — snaps parallel at %.2f m") : STR_C("Drag: shift the straight sideways — close: parallel snap at %.2f m"), offer.spacing);
intent.what = kind::straight_handle;
return intent;
}
}
return make(kind::straight_handle, hit == 2 ? "Drag: shift the straight sideways" : "Drag: move this end, the curves at it follow");
}
}