Add function to assert project time settings are ordered

This commit is contained in:
2026-04-12 14:10:48 +02:00
parent 95c87a75dd
commit 0212b9d2e7

View File

@@ -754,6 +754,12 @@ function readPositiveNumberDraft(source: string, label: string): number {
return value;
}
function assertProjectTimeSettingsAreOrdered(time: ProjectTimeSettings) {
if (time.sunriseTimeOfDayHours >= time.sunsetTimeOfDayHours) {
throw new Error("Project sunrise must be earlier than project sunset.");
}
}
function areVec2Equal(left: Vec2, right: Vec2): boolean {
return left.x === right.x && left.y === right.y;
}