evas_textblock: reduce content fit calculations 22/248022/1
authorali-alzyod <ali198724@gmail.com>
Thu, 19 Nov 2020 08:29:48 +0000 (10:29 +0200)
committerali-alzyod <ali198724@gmail.com>
Thu, 19 Nov 2020 08:58:43 +0000 (10:58 +0200)
Reviewers: woohyun, id213sin

Reviewed By: woohyun, id213sin

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D12187

Change-Id: I053bf185a07f5b698b14636ec07e771e6f94990f

src/lib/evas/canvas/evas_object_textblock.c

index 968378d..63e692c 100644 (file)
@@ -18473,6 +18473,10 @@ int fit_text_block(Evas_Object *eo_obj)
 
    TEXT_FIT_CONTENT_CONFIG * fc = &o->fit_content_config;
 
+   // If there are no text or Paragraphs, then do nothing
+   if (efl_canvas_textblock_is_empty_get(eo_obj))
+     return EVAS_ERROR_SUCCESS;
+
    if (fc->options == TEXTBLOCK_FIT_MODE_NONE && !fc->force_refit)
      return EVAS_ERROR_SUCCESS;