Page MenuHomePhabricator

Efl.Ui.Textpath: fix a size problem
ClosedPublic

Authored by kimcinoo on May 21 2019, 5:47 AM.

Details

Summary

Textpath set its hint_size using its position and calulated path information.
The path information is calculated using center postion, radius & start angle.
For example, if textpath position is 0,0 and center positon of path is 100,100
and radius 50, then text will be located on the rigth side of textpath object.

Moreover there is another problem.

[Step to reproduce]

  1. Launch elementary_test
  2. open Efl.Ui.Textpath
  3. see circle is not center aligned.
  4. click Clockwise 1 ~ 2 times center position is changed repeatedly.

This occurs because textpath size is calculated by position_set.
It does not make sense that changing postion defines its size.

So this patch is setting textpath hint_size using only given center position.
The text will position on the middle of textpath object always.

Diff Detail

Repository
rEFL core/efl
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
kimcinoo created this revision.May 21 2019, 5:47 AM

It seems that this patch has no reviewers specified. If you are unsure who can review your patch, please check this wiki page and see if anyone can be added: https://phab.enlightenment.org/w/maintainers_reviewers/

kimcinoo requested review of this revision.May 21 2019, 5:47 AM
Hermet requested changes to this revision.May 22 2019, 10:26 PM

Please check a comment.

src/lib/elementary/efl_ui_textpath.c
70

What happens if circle_set doesn't used?
The better method for this issue is to update the bezier origin position whenever position is changed.

ex)
_efl_ui_textpath_efl_gfx_entity_position_set()
{

EINA_INLIST_FOREACH(pd->segments, seg)
   update  seg->bezier origin position.

}

This revision now requires changes to proceed.May 22 2019, 10:26 PM
kimcinoo updated this revision to Diff 22330.May 23 2019, 1:46 AM

Enhanced based on comment. This is much more neat!

Hermet accepted this revision.May 23 2019, 4:09 AM
This revision is now accepted and ready to land.May 23 2019, 4:09 AM
This revision was automatically updated to reflect the committed changes.