aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorSimon Barber <simon.barber@meraki.net>2017-11-01 11:51:37 -0700
committerPeter Wu <peter@lekensteyn.nl>2017-11-07 10:39:24 +0000
commitfa2649ac61755b462ec49ea0a2bbfb8569dd0bad (patch)
tree2978f24aeb2828ad94e9317194969dc97be742a6 /ui
parent19b2ddcce1cdfc947220acfceefd0e3b98401909 (diff)
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>
Diffstat (limited to 'ui')
-rw-r--r--ui/qt/wireless_timeline.cpp13
1 files changed, 2 insertions, 11 deletions
diff --git a/ui/qt/wireless_timeline.cpp b/ui/qt/wireless_timeline.cpp
index 4f16159026..4a556a72ae 100644
--- a/ui/qt/wireless_timeline.cpp
+++ b/ui/qt/wireless_timeline.cpp
@@ -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();
}