mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-03 00:26:22 +01:00
feat(editor): the free ends of the tracks are marked red in the track mode
Each end of a rail track joined to nothing, where a train would run off, gets a red dot next to the white dots of the joints, in the 3D view near the camera and from above over the whole view. The ends are looked for again after an edit or once the camera leaves the place they were found for, not every frame.
This commit is contained in:
@@ -2122,6 +2122,16 @@ void editor_mode::draw_build_overlay() const
|
||||
drawlist->AddCircleFilled(screen, 3.5f, kJointColor);
|
||||
}
|
||||
}
|
||||
// the ends joined to nothing, where a train would run off
|
||||
for (auto const &point : free_end_points(eye, Global.EditorOrtho ? std::max(kDotsRange, static_cast<double>(Global.EditorOrthoExtent) * 2.0) : kDotsRange))
|
||||
{
|
||||
ImVec2 screen;
|
||||
if (in_reach(point) && projection.project(point, screen) && screen.x >= 0.0f && screen.y >= 0.0f && screen.x <= display.x && screen.y <= display.y)
|
||||
{
|
||||
drawlist->AddCircleFilled(screen, 5.0f, kFreeEndColor);
|
||||
drawlist->AddCircle(screen, 5.0f, IM_COL32(0, 0, 0, 160), 12, 1.0f);
|
||||
}
|
||||
}
|
||||
if (m_extend.active)
|
||||
{
|
||||
if (m_extend.track != nullptr)
|
||||
|
||||
Reference in New Issue
Block a user