mirror of
https://github.com/GothenburgBitFactory/timewarrior.git
synced 2025-07-07 20:06:39 +02:00
CmdReportDay: Corrected coordinate mapping
This commit is contained in:
parent
7c8f9d43c2
commit
7cbd34c7bd
1 changed files with 6 additions and 10 deletions
|
@ -199,17 +199,13 @@ static void renderInterval (
|
||||||
Range day_range (day, eod);
|
Range day_range (day, eod);
|
||||||
Interval clipped = clip (track, day_range);
|
Interval clipped = clip (track, day_range);
|
||||||
|
|
||||||
// TODO track may have started days ago.
|
auto start_mins = clipped.range.start.hour () * 60 + clipped.range.start.minute ();
|
||||||
auto start_hour = clipped.range.start.hour ();
|
auto end_mins = clipped.range.end.hour () * 60 + clipped.range.end.minute ();
|
||||||
auto start_min = clipped.range.start.minute ();
|
if (end_mins == 0)
|
||||||
auto end_hour = clipped.range.end.hour ();
|
end_mins = 23 * 60 + 59;
|
||||||
auto end_min = clipped.range.end.minute ();
|
|
||||||
|
|
||||||
auto start_block = quantizeTo15Minutes (start_min) / 15;
|
int start_offset = (start_mins / 15) + (spacing * (start_mins / 60));
|
||||||
auto end_block = quantizeTo15Minutes (end_min == 0 ? 60 : end_min) / 15;
|
int end_offset = (end_mins / 15) + (spacing * (end_mins / 60));
|
||||||
|
|
||||||
int start_offset = (start_hour - first_hour) * (4 + spacing) + start_block;
|
|
||||||
int end_offset = (end_hour - 1 - first_hour) * (4 + spacing) + end_block;
|
|
||||||
|
|
||||||
if (end_offset > start_offset)
|
if (end_offset > start_offset)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue