南京二号线哈尔滨线早晚点显示调整

This commit is contained in:
fan 2023-10-23 16:41:09 +08:00
parent d9b03b30f6
commit ca183eed7e

View File

@ -261,12 +261,13 @@ export default class TrainBody extends Group {
this.add(this.travelNum); this.add(this.travelNum);
} }
if (style.Train.common.hasDelayTime) { if (style.Train.common.hasDelayTime) {
const time = Math.abs(model.dt) <= 15 ? Math.abs(model.dt) : (model.dt > 0 ? '-' + model.dt : '+' + Math.abs(model.dt));
this.delayTime = new ETextName({ this.delayTime = new ETextName({
zlevel: model.zlevel, zlevel: model.zlevel,
z: model.z + 1, z: model.z + 1,
x: parseInt(model.point.x + style.Train.delayTime.trainDelayTimeOffset.x), x: parseInt(model.point.x + style.Train.delayTime.trainDelayTimeOffset.x),
y: parseInt(model.point.y + style.Train.delayTime.trainDelayTimeOffset.y), y: parseInt(model.point.y + style.Train.delayTime.trainDelayTimeOffset.y),
text: model.dt > 0 ? '+' + model.dt : model.dt, text: time,
textFill: '#DADA00', textFill: '#DADA00',
textStroke: style.trainTextColor, textStroke: style.trainTextColor,
textStrokeWidth: 0, textStrokeWidth: 0,