claude refactor #95

Merged
MineTec merged 24 commits from develop-refactor into develop 2026-05-08 19:49:43 +00:00
Showing only changes of commit c32e64fe74 - Show all commits
@@ -1169,8 +1169,23 @@ class _PeriodLayout {
return y; return y;
} }
double yOfDateTime(DateTime t) => double yOfDateTime(DateTime t) {
yOf(TimeOfDay(hour: t.hour, minute: t.minute)); final tMin = t.hour * 60 + t.minute + t.second / 60.0;
var y = 0.0;
for (final p in periods) {
final pStart = p.start.hour * 60 + p.start.minute;
final pEnd = p.end.hour * 60 + p.end.minute;
final h = _h(p);
if (tMin < pStart) return y;
if (tMin <= pEnd) {
final span = pEnd - pStart;
final ratio = span > 0 ? (tMin - pStart) / span : 0.0;
return y + ratio * h;
}
y += h;
}
return y;
}
/// Period at a given y-offset. If y falls into a break, returns the next /// Period at a given y-offset. If y falls into a break, returns the next
/// non-break period. Returns null when y is past the last period. /// non-break period. Returns null when y is past the last period.