diff options
Diffstat (limited to 'generic/Text.c')
-rw-r--r-- | generic/Text.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/generic/Text.c b/generic/Text.c index 96b4974..2d820a0 100644 --- a/generic/Text.c +++ b/generic/Text.c @@ -492,7 +492,7 @@ ComputeSelection(ZnItem item, lines = ZnListArray(text->text_info); sel_first = Tcl_UtfAtIndex(text->text, ti->sel_first)-text->text; - sel_last = Tcl_UtfAtIndex(text->text, ti->sel_last+1)-text->text; + sel_last = Tcl_UtfAtIndex(text->text, ti->sel_last)-text->text; for (i = 0, lines_ptr = lines; i < num_lines; i++, lines_ptr++) { /* * Compute the selection first and last line as well as @@ -515,7 +515,7 @@ ComputeSelection(ZnItem item, /*printf("sel_start_offset 2 : %d\n", *sel_start_offset);*/ } } - byte_index = ti->sel_last+1 - line_index; + byte_index = ti->sel_last - line_index; *sel_last_line = i; if (byte_index == lines_ptr->num_bytes+1) *sel_stop_offset = lines_ptr->width; @@ -1554,13 +1554,6 @@ PointToChar(TextItem text, p.y = ZnNearestInt(p.y); /* - * Point above text, returns index 0. - */ - if (p.y < 0) { - return 0; - } - - /* * Find the text line under point. */ num_lines = ZnListSize(text->text_info); |