Ignore:
Timestamp:
11/05/07 10:48:26 (13 years ago)
Author:
Nicholas Riley
Message:

AntiRSI.xcodeproj: Explicitly use 10.4 Universal SDK for building on Leopard.

AntiRSI.m: Consistently use rounding instead of truncation for display: fixes times ordered 3:01, 2:00, 2:59, etc. Thanks to Andy Reitz for pointing this out.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Cocoa/AntiRSI/AntiRSI.m

    r346 r348  
    598598- (NSString *)sessionTimeString;
    599599{
    600     return [NSString stringWithFormat:@"Session: %d:%02d:%02d", (int)session_t / 3600,
    601             ((int)session_t / 60) % 60, lrint(session_t) % 60];
     600    int seconds = lrint(session_t);
     601    return [NSString stringWithFormat:@"Session: %d:%02d:%02d", seconds / 3600,
     602            (seconds / 60) % 60, seconds % 60];
    602603}
    603604
     
    608609   
    609610    // time left
    610     double timeLeft = duration - progress_t;
    611     [time setStringValue:[NSString stringWithFormat:@"%d:%02d", (int)timeLeft / 60, lrint(timeLeft) % 60]];
     611    int timeLeft = lrint(duration - progress_t);
     612    [time setStringValue:[NSString stringWithFormat:@"%d:%02d", timeLeft / 60, timeLeft % 60]];
    612613   
    613614    // cumulative typing time in this session (e.g. today)
Note: See TracChangeset for help on using the changeset viewer.