17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-31 05:20:52 +01:00

feat(editor): texture of the rails of path 2 of a switch set apart

(cherry picked from commit 16c77ab6fb)
This commit is contained in:
2026-10-21 15:50:00 +02:00
committed by maj00r
parent 4d2f95aa43
commit 7e284b293d
3 changed files with 29 additions and 4 deletions

View File

@@ -3130,7 +3130,8 @@ TTrack *editor_track::create_switch(switch_template const &Template, std::vector
{
std::ostringstream text;
text.precision(std::numeric_limits<double>::digits10);
write_header(text, "switch", Template.length, 10.0, Style, Style.m_material1);
// a switch styled after a switch keeps the rails of its path 2
write_header(text, "switch", Template.length, 10.0, Style, Style.eType == tt_Switch ? Style.m_material2 : Style.m_material1);
write_points(text, Paths[0]);
write_points(text, Paths[1]);
if (auto const trackbed{ballast_of(Style)}; trackbed != null_handle)