int mins;
int secs;
int millisecs;
+ bool negative = false;
if (_off) {
_layout->set_text ("\u2012\u2012:\u2012\u2012:\u2012\u2012.\u2012\u2012\u2012");
return;
}
+ if (when < 0) {
+ when = -when;
+ negative = true;
+ }
+
left = when;
hrs = (int) floor (left / (_session->frame_rate() * 60.0f * 60.0f));
left -= (framecnt_t) floor (hrs * _session->frame_rate() * 60.0f * 60.0f);
secs = (int) floor (left / (float) _session->frame_rate());
left -= (framecnt_t) floor (secs * _session->frame_rate());
millisecs = floor (left * 1000.0 / (float) _session->frame_rate());
+
+ if (negative) {
+ snprintf (buf, sizeof (buf), "-%02" PRId32 ":%02" PRId32 ":%02" PRId32 ".%03" PRId32, hrs, mins, secs, millisecs);
+ } else {
+ snprintf (buf, sizeof (buf), " %02" PRId32 ":%02" PRId32 ":%02" PRId32 ".%03" PRId32, hrs, mins, secs, millisecs);
+ }
- snprintf (buf, sizeof (buf), "%02" PRId32 ":%02" PRId32 ":%02" PRId32 ".%03" PRId32, hrs, mins, secs, millisecs);
_layout->set_text (buf);
}
return;
}
- negative = when < 0;
-
- if (negative) {
+ if (when < 0) {
when = -when;
+ negative = true;
}
if (is_duration) {
return;
}
- negative = when < 0;
-
- if (negative) {
+ if (when < 0) {
when = -when;
+ negative = true;
}
/* handle a common case */
* x and y.
*/
- y = ev->y - ((get_height() - layout_height)/2);
+ y = ev->y - ((upper_height - layout_height)/2);
x = ev->x - x_leading_padding;
if (_layout->xy_to_index (x * PANGO_SCALE, y * PANGO_SCALE, index, trailing)) {
* x and y.
*/
- y = ev->y - ((get_height() - layout_height)/2);
+ y = ev->y - ((upper_height - layout_height)/2);
x = ev->x - x_leading_padding;
if (!_layout->xy_to_index (x * PANGO_SCALE, y * PANGO_SCALE, index, trailing)) {