forked from osmocom/wireshark
wireless_timeline: fix blank display
Sometimes when a file opens the timeline does not display, also sometimes when zooming it disappears. Change-Id: I141eaef5f332a1de9af133abbeccede7c1cf5502 Reviewed-on: https://code.wireshark.org/review/24209 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot Reviewed-by: Peter Wu <peter@lekensteyn.nl>
This commit is contained in:
parent
19b2ddcce1
commit
fa2649ac61
|
@ -185,7 +185,7 @@ void WirelessTimeline::mouseReleaseEvent(QMouseEvent *event)
|
|||
void WirelessTimeline::clip_tsf()
|
||||
{
|
||||
// did we go past the start of the file?
|
||||
if (start_tsf < first->start_tsf) {
|
||||
if (((gint64) start_tsf) < ((gint64) first->start_tsf)) {
|
||||
// align the start of the file at the left edge
|
||||
guint64 shift = first->start_tsf - start_tsf;
|
||||
start_tsf += shift;
|
||||
|
@ -441,16 +441,7 @@ void WirelessTimeline::zoom(double x_fraction)
|
|||
guint64 span = pow(file_range, 1.0 - zoom_level / TIMELINE_MAX_ZOOM);
|
||||
start_tsf = center - span * x_fraction;
|
||||
end_tsf = center + span * (1.0 - x_fraction);
|
||||
|
||||
/* if we go out of range for the whole file, clamp it */
|
||||
if (start_tsf < first->start_tsf) {
|
||||
end_tsf += first->start_tsf - start_tsf;
|
||||
start_tsf = first->start_tsf;
|
||||
} else if (end_tsf > last->end_tsf) {
|
||||
start_tsf -= end_tsf - last->end_tsf;
|
||||
end_tsf = last->end_tsf;
|
||||
}
|
||||
|
||||
clip_tsf();
|
||||
update();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue