ajwillia-ms pushed a commit to branch master.

http://git.enlightenment.org/tools/edi.git/commit/?id=133b41ff244bc34cc86aef111aabe9dccc7b8016

commit 133b41ff244bc34cc86aef111aabe9dccc7b8016
Author: Andy Williams <[email protected]>
Date:   Sun Feb 22 21:50:34 2015 +0000

    elm_code: don't run resize code more than needed
    
    Our cells are now always the size of the widget so
    we can avoid the safety checks...
---
 elm_code/src/lib/elm_code_widget.c | 15 +++------------
 1 file changed, 3 insertions(+), 12 deletions(-)

diff --git a/elm_code/src/lib/elm_code_widget.c 
b/elm_code/src/lib/elm_code_widget.c
index 55d4fc0..d16d189 100644
--- a/elm_code/src/lib/elm_code_widget.c
+++ b/elm_code/src/lib/elm_code_widget.c
@@ -57,7 +57,7 @@ _elm_code_widget_scroll_by(Elm_Code_Widget *widget, int by_x, 
int by_y)
    elm_scroller_region_show(pd->scroller, x, y, w, h);
 }
 
-static Eina_Bool
+static void
 _elm_code_widget_resize(Elm_Code_Widget *widget)
 {
    Elm_Code_Line *line;
@@ -70,7 +70,7 @@ _elm_code_widget_resize(Elm_Code_Widget *widget)
    gutter = elm_code_widget_text_left_gutter_width_get(widget);
 
    if (!pd->code)
-     return EINA_FALSE;
+     return;
 
    evas_object_geometry_get(widget, NULL, NULL, &ww, &wh);
    evas_object_textgrid_cell_size_get(pd->grid, &cw, &ch);
@@ -95,8 +95,6 @@ _elm_code_widget_resize(Elm_Code_Widget *widget)
      _elm_code_widget_scroll_by(widget, 
         (pd->gravity_x == 1.0 && ww > old_width) ? ww - old_width : 0,
         (pd->gravity_y == 1.0 && wh > old_height) ? wh - old_height : 0);
-
-   return h > 0 && w > 0;
 }
 
 static void
@@ -147,9 +145,6 @@ _elm_code_widget_fill_line(Elm_Code_Widget *widget, 
Evas_Textgrid_Cell *cells, E
    pd = eo_data_scope_get(widget, ELM_CODE_WIDGET_CLASS);
    gutter = elm_code_widget_text_left_gutter_width_get(widget);
 
-   if (!_elm_code_widget_resize(widget))
-     return;
-
    length = line->length;
    evas_object_textgrid_size_get(pd->grid, &w, NULL);
 
@@ -210,8 +205,7 @@ _elm_code_widget_fill(Elm_Code_Widget *widget)
 
    pd = eo_data_scope_get(widget, ELM_CODE_WIDGET_CLASS);
 
-   if (!_elm_code_widget_resize(widget))
-     return;
+   _elm_code_widget_resize(widget);
    evas_object_textgrid_size_get(pd->grid, &w, &h);
 
    for (y = 1; y <= (unsigned int) h && y <= 
elm_code_file_lines_get(pd->code->file); y++)
@@ -231,9 +225,6 @@ _elm_code_widget_line_cb(void *data, Eo *obj EINA_UNUSED,
 
    widget = (Elm_Code_Widget *)data;
 
-   if (!_elm_code_widget_resize(widget))
-     return EINA_TRUE;
-
    // FIXME refresh just the row unless we have resized (by being the result 
of a row append)
    _elm_code_widget_fill(widget);
 

-- 


Reply via email to