Prevent crash in DashboardItemInstruments when using dates before 2000 (closes #1878). Remove the padding images from New Horizons that screw up the instruments timing

This commit is contained in:
Alexander Bock
2022-03-30 10:45:01 +02:00
parent 31586bc462
commit 5ea93cdd7b
2 changed files with 4 additions and 3 deletions
@@ -27,7 +27,7 @@ local images = asset.syncedResource({
Name = "Pluto Images",
Type = "HttpSynchronization",
Identifier = "newhorizons_plutoencounter_pluto_images",
Version = 1
Version = 2
})
local plutoRadius = 1.173E6
@@ -131,8 +131,9 @@ void DashboardItemInstruments::render(glm::vec2& penPosition) {
double previous = sequencer.prevCaptureTime(currentTime);
double next = sequencer.nextCaptureTime(currentTime);
double remaining = sequencer.nextCaptureTime(currentTime) - currentTime;
const float t = static_cast<float>(1.0 - remaining / (next - previous));
double remaining = next - currentTime;
float t = static_cast<float>(1.0 - remaining / (next - previous));
t = std::clamp(t, 0.f, 1.f);
if (remaining > 0.0) {
RenderFont(