From a9f8685e282d1ff967b9bbb77fd214cd489b6d70 Mon Sep 17 00:00:00 2001 From: Jaehyun Cho Date: Mon, 17 Jun 2019 21:20:53 +0900 Subject: [PATCH] evas_object_text_block: fix halign_set to work New format's halign and halign_auto were initialized with default values after the new format copied halign and halign_auto from original format. This caused that the halign value given by halign_set was not applied. To keep backward compatibility and to resolve the bug, halign and halign_auto are initialized only for legacy textblock. Change-Id: I9639fcea898c4bea41c1eed6c91cffd7feadd695 --- src/lib/evas/canvas/evas_object_textblock.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c index 47a018d..5df3552 100644 --- a/src/lib/evas/canvas/evas_object_textblock.c +++ b/src/lib/evas/canvas/evas_object_textblock.c @@ -3643,10 +3643,21 @@ _layout_format_push(Ctxt *c, Evas_Object_Textblock_Format *fmt, *fmt = c->o->default_format.format; fmt->ref = 1; fmt->font.bitmap_scalable = _FMT_INFO(bitmap_scalable); - /* TIZEN_ONLY(20180509): Fix default values for text alignment */ - fmt->halign = 0.0; - fmt->halign_auto = EINA_TRUE; - fmt->valign = -1.0; + + /* TIZEN_ONLY(20190617): The initialized halign and halign_auto caused + * that the halign value given by halign_set was not applied. + * To keep backward compatibility and to resolve the bug, halign and + * halign_auto are initialized only for legacy textblock. */ + Evas_Object_Protected_Data *obj; + obj = efl_data_scope_get(c->obj, EFL_CANVAS_OBJECT_CLASS); + if (obj->legacy.ctor) + { + /* TIZEN_ONLY(20180509): Fix default values for text alignment */ + fmt->halign = 0.0; + fmt->halign_auto = EINA_TRUE; + fmt->valign = -1.0; + /* END */ + } /* END */ // Apply font if specified -- 2.7.4