mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-12-01 07:07:05 +01:00
Merge feat/editor-turnout-catalogue into feat/editor-model-in-editor
This commit is contained in:
@@ -2178,7 +2178,7 @@ void editor_mode::lay_finish(editor_track::snap_target const &End)
|
||||
tool.points.clear();
|
||||
tool.modes.clear();
|
||||
tool.start = {};
|
||||
tool.laid_step = m_history.size();
|
||||
tool.laid_step = history_top();
|
||||
straight_refresh();
|
||||
}
|
||||
|
||||
@@ -2189,7 +2189,7 @@ void editor_mode::lay_told(double const Length, std::size_t const Tracks)
|
||||
tool.status_time = ImGui::GetTime();
|
||||
tool.laid_now = true;
|
||||
tool.notes_open = false;
|
||||
tool.laid_step = m_history.size();
|
||||
tool.laid_step = history_top();
|
||||
}
|
||||
|
||||
void editor_mode::lay_enter()
|
||||
@@ -2389,13 +2389,18 @@ alignment::limits editor_mode::laying_norms() const
|
||||
return norms;
|
||||
}
|
||||
|
||||
std::uint64_t editor_mode::history_top() const
|
||||
{
|
||||
return m_history.empty() ? 0 : m_history.back().serial;
|
||||
}
|
||||
|
||||
editor_mode::lay_state editor_mode::lay_panel_state() const
|
||||
{
|
||||
if (m_extend.active)
|
||||
return lay_state::extending;
|
||||
if (false == m_lay.points.empty())
|
||||
return lay_state::clicking;
|
||||
if (m_lay.laid_now && m_lay.laid_step == m_history.size())
|
||||
if (m_lay.laid_now && m_lay.laid_step == history_top())
|
||||
return lay_state::laid;
|
||||
return lay_state::ready;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user