ali-alzyod pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=f56004db6ead55df47ac7355651ed911c88114c0

commit f56004db6ead55df47ac7355651ed911c88114c0
Author: ali-alzyod <ali198...@gmail.com>
Date:   Thu Nov 19 10:29:48 2020 +0200

    evas_textblock: reduce content fit calculations
    
    Reviewers: woohyun, id213sin
    
    Reviewed By: woohyun, id213sin
    
    Subscribers: cedric, #reviewers, #committers
    
    Tags: #efl
    
    Differential Revision: https://phab.enlightenment.org/D12187
---
 src/lib/evas/canvas/evas_object_textblock.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/lib/evas/canvas/evas_object_textblock.c 
b/src/lib/evas/canvas/evas_object_textblock.c
index c8fd924b78..fcf16b7f95 100644
--- a/src/lib/evas/canvas/evas_object_textblock.c
+++ b/src/lib/evas/canvas/evas_object_textblock.c
@@ -17728,6 +17728,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;
 

-- 


Reply via email to