diff options
author | Gerald Combs <gerald@wireshark.org> | 2015-07-23 11:19:38 -0700 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2015-07-23 18:23:35 +0000 |
commit | a5f7b84dba0b002124fcc6ed44e99394cf708ca0 (patch) | |
tree | a6cfaf96f3726e3cf47f507b424ad9888ca695df /ui/qt | |
parent | 9bca1274308c1e6f88af1fe69a73cfa72b08412e (diff) |
Fixup selected packet arithmetic.
Or, "I can mathing" if you prefer meme-based commit messages.
Change-Id: I8fd1db0e2a1e99525191ae6b33115ef8e38ab2f4
Reviewed-on: https://code.wireshark.org/review/9758
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'ui/qt')
-rw-r--r-- | ui/qt/packet_list.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ui/qt/packet_list.cpp b/ui/qt/packet_list.cpp index 0348d08faf..b012c3e7bc 100644 --- a/ui/qt/packet_list.cpp +++ b/ui/qt/packet_list.cpp @@ -1364,6 +1364,8 @@ void PacketList::drawNearOverlay() cur_line = next_line; } + // If the selected packet is in the overlay set selected_pos + // accordingly. Otherwise, pin it to either the top or bottom. if (selectionModel()->hasSelection()) { int sel_row = selectionModel()->currentIndex().row(); if (sel_row < start) { @@ -1371,7 +1373,7 @@ void PacketList::drawNearOverlay() } else if (sel_row >= end) { selected_pos = overlay.height() - 1; } else { - selected_pos = sel_row * overlay.height() / packet_list_model_->rowCount(); + selected_pos = (sel_row - start) * o_height / o_rows; } } |