Duplicated isolation name bugfix

*Fixed duplicated isolation names being rendered on switches
This commit is contained in:
izawartka 2025-06-02 22:46:07 +02:00
parent df19b92bb2
commit 6d4aef606a
3 changed files with 6 additions and 0 deletions

View File

@ -4,6 +4,10 @@ export default function IsolationIdRenderer(props) {
const [x, y] = pos.toSVGCoords();
const text = object.id_isolation ?? '';
if (object.hide_isolation || !text) {
return null;
}
return (
<text
x={x}

View File

@ -59,6 +59,7 @@ export default class Switch extends SceneryObject {
this.trackB = this._createGetSwitchTrack(scenery, this.id+"B", this.outs[1], this.outs[3], r);
if(this.trackB) {
this.trackB.hide_isolation = true; // hide isolation for the second track
scenery.addObject(this.trackB);
}
}

View File

@ -15,6 +15,7 @@ export default class Track extends SceneryObject {
nextTrack = null;
start_slope;
end_slope;
hide_isolation = false;
constructor(id, pos, rot, len, r, previd, nextid, id_station, start_slope, end_slope, id_isolation, maxspeed, derailspeed) {
super(id, pos, rot);