diff options
author | Andy Williams <andy@andywilliams.me> | 2016-04-28 22:51:03 +0100 |
---|---|---|
committer | Andy Williams <andy@andywilliams.me> | 2016-04-28 22:51:03 +0100 |
commit | 006372ae26cbb48b38de989ef1b0d8bed151459d (patch) | |
tree | 57b03b4e8d0cb377af17972bd5ba8af403c571f1 | |
parent | b2eb741a30e424ee4e0fd9f356c08ea0ecee1912 (diff) | |
download | efl-006372ae26cbb48b38de989ef1b0d8bed151459d.tar.gz |
[editor] fix issue where selections didn't refresh
Around the extremities of the ui it was possible
to not refresh correctly - fixed.
-rw-r--r-- | legacy/elm_code/src/lib/widget/elm_code_widget.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/legacy/elm_code/src/lib/widget/elm_code_widget.c b/legacy/elm_code/src/lib/widget/elm_code_widget.c index 175849e515..daf7b18acb 100644 --- a/legacy/elm_code/src/lib/widget/elm_code_widget.c +++ b/legacy/elm_code/src/lib/widget/elm_code_widget.c @@ -409,18 +409,20 @@ _elm_code_widget_fill_range(Elm_Code_Widget *widget, unsigned int first_row, uns static void _elm_code_widget_refresh(Elm_Code_Widget *widget) { - Evas_Coord scroll_y, scroll_h, ch; + Evas_Coord scroll_y, scroll_h, oy; unsigned int first_row, last_row; Elm_Code_Widget_Data *pd; pd = eo_data_scope_get(widget, ELM_CODE_WIDGET_CLASS); - _elm_code_widget_cell_size_get(widget, NULL, &ch); + evas_object_geometry_get(widget, NULL, &oy, NULL, NULL); elm_scroller_region_get(pd->scroller, NULL, &scroll_y, NULL, &scroll_h); + if (scroll_h == 0) + return; - first_row = scroll_y / ch + 1; - last_row = (scroll_y + scroll_h) / ch + 1; + elm_code_widget_position_at_coordinates_get(widget, 0, oy, &first_row, NULL); + elm_code_widget_position_at_coordinates_get(widget, 0, oy + scroll_h, &last_row, NULL); if (last_row > elm_code_file_lines_get(pd->code->file)) last_row = elm_code_file_lines_get(pd->code->file); @@ -640,7 +642,7 @@ _elm_code_widget_position_at_coordinates_get(Eo *obj, Elm_Code_Widget_Data *pd, { evas_object_geometry_get(grid, NULL, &rowy, NULL, NULL); - if (rowy + sy - oy < y) + if (rowy + sy - oy - 1<= y) break; number--; |