Fix edge case triggered by mouse being out-of-window.

This commit is contained in:
Bartosz Taudul 2022-01-29 15:53:50 +01:00
parent df96293477
commit 361782f3fd
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3

View File

@ -257,9 +257,16 @@ const char* TimeToStringExact( int64_t _ns )
const auto h = int64_t( ns / ( 1000ll * 1000 * 1000 * 60 * 60 ) - d * 24 ); const auto h = int64_t( ns / ( 1000ll * 1000 * 1000 * 60 * 60 ) - d * 24 );
const auto m = int64_t( ns / ( 1000ll * 1000 * 1000 * 60 ) - d * ( 60 * 24 ) - h * 60 ); const auto m = int64_t( ns / ( 1000ll * 1000 * 1000 * 60 ) - d * ( 60 * 24 ) - h * 60 );
const auto s = int64_t( ns / ( 1000ll * 1000 * 1000 ) - d * ( 60 * 60 * 24 ) - h * ( 60 * 60 ) - m * 60 ); const auto s = int64_t( ns / ( 1000ll * 1000 * 1000 ) - d * ( 60 * 60 * 24 ) - h * ( 60 * 60 ) - m * 60 );
assert( d < 100 ); if( d < 100 )
{
PrintTinyInt( buf, d ); PrintTinyInt( buf, d );
*buf++ = 'd'; *buf++ = 'd';
}
else
{
memcpy( buf, "100+d", 5 );
buf += 5;
}
PrintTinyInt0( buf, h ); PrintTinyInt0( buf, h );
*buf++ = ':'; *buf++ = ':';
PrintTinyInt0( buf, m ); PrintTinyInt0( buf, m );