aboutsummaryrefslogtreecommitdiffstats
path: root/gtk/main_proto_draw.c
diff options
context:
space:
mode:
authorstig <stig@f5534014-38df-0310-8fa8-9805f1628bb7>2009-11-05 10:11:45 +0000
committerstig <stig@f5534014-38df-0310-8fa8-9805f1628bb7>2009-11-05 10:11:45 +0000
commitd9c8bc620e18213e129f24440460f5bddb1d6c38 (patch)
tree703ac8b74cb97235aa1f2349c9d4e77349fba312 /gtk/main_proto_draw.c
parent236d51862d7a84c9b9d8cdb3c46074580d4eb487 (diff)
Select the previous byte in the packet bytes hex view when clicking in
the column just behind the first half and the last half. This behavior is more user friendly. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@30831 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'gtk/main_proto_draw.c')
-rw-r--r--gtk/main_proto_draw.c19
1 files changed, 6 insertions, 13 deletions
diff --git a/gtk/main_proto_draw.c b/gtk/main_proto_draw.c
index 95ebc0b75a..bb8b5e3ea0 100644
--- a/gtk/main_proto_draw.c
+++ b/gtk/main_proto_draw.c
@@ -340,20 +340,15 @@ byte_view_select(GtkWidget *widget, GdkEventButton *event)
* There are BYTES_PER_LINE/2 bytes displayed in the first
* half; there are 2 characters per byte, plus a separating
* blank after all but the last byte's characters.
- *
- * Then subtract 1 to get the last column of the first half
- * rather than the first column after the first half.
*/
digits_end_1 = digits_start_1 + (BYTES_PER_LINE/2)*2 +
- (BYTES_PER_LINE/2 - 1) - 1;
+ (BYTES_PER_LINE/2 - 1);
/*
* The column of the first hex digit in the second half.
- * Add back the 1 to get the first column after the first
- * half, and then add 2 for the 2 separating blanks between
- * the halves.
+ * Add 2 for the 2 separating blanks between the halves.
*/
- digits_start_2 = digits_end_1 + 3;
+ digits_start_2 = digits_end_1 + 2;
/*
* The column of the last hex digit in the second half.
@@ -361,15 +356,13 @@ byte_view_select(GtkWidget *widget, GdkEventButton *event)
* "digits_start_1".
*/
digits_end_2 = digits_start_2 + (BYTES_PER_LINE/2)*2 +
- (BYTES_PER_LINE/2 - 1) - 1;
+ (BYTES_PER_LINE/2 - 1);
/*
* The column of the first "text dump" character in the first half.
- * Add back the 1 to get the first column after the second
- * half's hex dump, and then add 3 for the 3 separating blanks
- * between the hex and text dummp.
+ * Add 3 for the 3 separating blanks between the hex and text dump.
*/
- text_start_1 = digits_end_2 + 4;
+ text_start_1 = digits_end_2 + 3;
/*
* The column of the last "text dump" character in the first half.