修复了车闪现的问题
This commit is contained in:
		@@ -193,11 +193,11 @@ QString BusStrategyBase::PrintState(int remaining_time) const
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    QString str = QString::asprintf("Time:%d\n", bus_tick);
 | 
					    QString str = QString::asprintf("Time:%d\n", bus_tick);
 | 
				
			||||||
    str += "BUS:\n";
 | 
					    str += "BUS:\n";
 | 
				
			||||||
    str += QString::asprintf("position:%lf\n", bus_model->GetBusPosition(remaining_time));
 | 
					    str += QString::asprintf("position:%.3lf\n", bus_model->GetBusPosition(remaining_time));
 | 
				
			||||||
    str = str + "target:" + target + "\n";
 | 
					    str = str + "target:" + target + "\n";
 | 
				
			||||||
    str += "STATION:\n";
 | 
					    str += "STATION:\n";
 | 
				
			||||||
    str = str + "clockwise" + clockwise + "\n";
 | 
					    str = str + "clockwise:" + clockwise + "\n";
 | 
				
			||||||
    str = str + "counterclockwise" + counterclockwise + "\n";
 | 
					    str = str + "counterclockwise:" + counterclockwise + "\n";
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return str;
 | 
					    return str;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -162,5 +162,7 @@ void MainWindow::EndTickTimerSlot()
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
void MainWindow::BeginBusTimerSlot(int direction, int duration)
 | 
					void MainWindow::BeginBusTimerSlot(int direction, int duration)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    bus_timer->start(duration);
 | 
					    // 这里得多计上一段时间
 | 
				
			||||||
 | 
					    // 执行动画需要消耗时间
 | 
				
			||||||
 | 
					    bus_timer->start(duration + 20);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
		Reference in New Issue
	
	Block a user