summaryrefslogtreecommitdiff
path: root/src/lib/edje/edje_calc.c
diff options
context:
space:
mode:
authorYoungbok Shin <youngb.shin@samsung.com>2017-07-04 13:53:59 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-07-04 14:13:13 +0900
commit0735f6aa612476a9f126747269cb3761b9e9aeba (patch)
tree148d1e1010341010fcd531bc3418c4a5e1b052c8 /src/lib/edje/edje_calc.c
parenta4b79fdbe16e1495c187dc4f9da99924cf51e539 (diff)
edje: support legacy Textblock calculation logic for 1.18 edje file
Summary: From EFL 1.19, Edje Textblock calculation logic was fixed according to Edje documents. But, it broke old edje files which ignored text.min option for minimum width. Even if the old edje files were wrong, we need to support them as discussed from T5548. Also, this patch will change default efl_version to 1.18 from 1.19. So, without efl_version property, edje file will run on the legacy logic. Fixes T5548 Test Plan: Turn on/off presentation mode in Enlightenment. Reviewers: herdsman, cedric, jpeg, zmike, raster Subscribers: stefan_schmidt Maniphest Tasks: T5548 Differential Revision: https://phab.enlightenment.org/D4967 Adjusted by @jpeg
Diffstat (limited to 'src/lib/edje/edje_calc.c')
-rw-r--r--src/lib/edje/edje_calc.c655
1 files changed, 377 insertions, 278 deletions
diff --git a/src/lib/edje/edje_calc.c b/src/lib/edje/edje_calc.c
index 47e918cdcc..fdae32a975 100644
--- a/src/lib/edje/edje_calc.c
+++ b/src/lib/edje/edje_calc.c
@@ -1467,6 +1467,369 @@ _edje_part_recalc_single_textblock_scale_range_adjust(Edje_Part_Description_Text
1467 return scale; 1467 return scale;
1468} 1468}
1469 1469
1470/*
1471 * Legacy function for min/max calculation of textblock part.
1472 * It can't calculate min/max properly in many cases.
1473 *
1474 * To keep backward compatibility, it will be used for old version of EDJ files.
1475 * You can't see proper min/max result accroding to documents with this function.
1476 */
1477static void
1478_edje_part_recalc_single_textblock_min_max_calc_legacy(Edje_Real_Part *ep,
1479 Edje_Part_Description_Text *chosen_desc,
1480 Edje_Calc_Params *params,
1481 int *minw, int *minh,
1482 int *maxw, int *maxh)
1483{
1484 Evas_Coord tw, th, ins_l, ins_r, ins_t, ins_b;
1485
1486 /* Legacy code for Textblock min/max calculation */
1487 if ((chosen_desc->text.min_x) || (chosen_desc->text.min_y))
1488 {
1489 int mw = 0, mh = 0;
1490
1491 tw = th = 0;
1492 if (!chosen_desc->text.min_x)
1493 {
1494 efl_gfx_size_set(ep->object, TO_INT(params->eval.w), TO_INT(params->eval.h));
1495 efl_canvas_text_size_formatted_get(ep->object, &tw, &th);
1496 }
1497 else
1498 evas_object_textblock_size_native_get(ep->object, &tw, &th);
1499 evas_object_textblock_style_insets_get(ep->object, &ins_l,
1500 &ins_r, &ins_t, &ins_b);
1501 mw = ins_l + tw + ins_r;
1502 mh = ins_t + th + ins_b;
1503 if (minw && chosen_desc->text.min_x)
1504 {
1505 if (mw > *minw) *minw = mw;
1506 }
1507 if (minh && chosen_desc->text.min_y)
1508 {
1509 if (mh > *minh) *minh = mh;
1510 }
1511 }
1512
1513 if ((chosen_desc->text.max_x) || (chosen_desc->text.max_y))
1514 {
1515 int mw = 0, mh = 0;
1516
1517 tw = th = 0;
1518 if (!chosen_desc->text.max_x)
1519 {
1520 efl_gfx_size_set(ep->object, TO_INT(params->eval.w), TO_INT(params->eval.h));
1521 efl_canvas_text_size_formatted_get(ep->object, &tw, &th);
1522 }
1523 else
1524 evas_object_textblock_size_native_get(ep->object, &tw, &th);
1525 evas_object_textblock_style_insets_get(ep->object, &ins_l, &ins_r,
1526 &ins_t, &ins_b);
1527 mw = ins_l + tw + ins_r;
1528 mh = ins_t + th + ins_b;
1529 if (maxw && chosen_desc->text.max_x)
1530 {
1531 if (mw > *maxw) *maxw = mw;
1532 if (minw && (*maxw < *minw)) *maxw = *minw;
1533 }
1534 if (maxh && chosen_desc->text.max_y)
1535 {
1536 if (mh > *maxh) *maxh = mh;
1537 if (minh && (*maxh < *minh)) *maxh = *minh;
1538 }
1539 }
1540}
1541
1542static void
1543_edje_part_recalc_single_textblock_min_max_calc(Edje_Real_Part *ep,
1544 Edje_Part_Description_Text *chosen_desc,
1545 Edje_Calc_Params *params,
1546 int *minw, int *minh,
1547 int *maxw, int *maxh)
1548{
1549 Evas_Coord tw, th, ins_l, ins_r, ins_t, ins_b;
1550 Evas_Coord min_calc_w = 0, min_calc_h = 0;
1551
1552 /* min_calc_* values need to save calculated minumum size
1553 * for maximum size calculation */
1554 if (minw) min_calc_w = *minw;
1555 if (minh) min_calc_h = *minh;
1556
1557 if ((chosen_desc->text.min_x) || (chosen_desc->text.min_y))
1558 {
1559 evas_object_textblock_style_insets_get(ep->object, &ins_l,
1560 &ins_r, &ins_t, &ins_b);
1561
1562 tw = th = 0;
1563 if (!chosen_desc->text.min_x)
1564 {
1565 /* text.min: 0 1
1566 * text.max: X X */
1567 int temp_h = TO_INT(params->eval.h);
1568 int temp_w = TO_INT(params->eval.w);
1569
1570 if (min_calc_w > temp_w)
1571 temp_w = min_calc_w;
1572 if ((!chosen_desc->text.max_x) &&
1573 maxw && (*maxw > -1) && (*maxw < temp_w))
1574 temp_w = *maxw;
1575
1576 if (chosen_desc->text.max_y)
1577 {
1578 /* text.min: 0 1
1579 * text.max: X 1 */
1580 temp_h = INT_MAX / 10000;
1581 }
1582 else if (maxh && (*maxh > TO_INT(params->eval.h)))
1583 {
1584 /* text.min: 0 1
1585 * text.max: X 0
1586 * And there is a limit for height. */
1587 temp_h = *maxh;
1588 }
1589
1590 /* If base width for calculation is 0,
1591 * don't get meaningless height for multiline */
1592 if (temp_w > 0)
1593 {
1594 efl_gfx_size_set(ep->object, temp_w, temp_h);
1595 efl_canvas_text_size_formatted_get(ep->object, &tw, &th);
1596
1597 tw += ins_l + ins_r;
1598 th += ins_t + ins_b;
1599 }
1600 else
1601 {
1602 efl_canvas_text_size_native_get(ep->object, NULL, &th);
1603
1604 th += ins_t + ins_b;
1605 }
1606 }
1607 else
1608 {
1609 /* text.min: 1 X
1610 * text.max: X X */
1611 if (chosen_desc->text.min_y && (!chosen_desc->text.max_x) &&
1612 maxw && (*maxw > -1))
1613 {
1614 /* text.min: 1 1
1615 * text.max: 0 X */
1616 int temp_w, temp_h;
1617
1618 temp_w = *maxw;
1619 temp_h = INT_MAX / 10000;
1620
1621 if (min_calc_w > temp_w)
1622 temp_w = min_calc_w;
1623
1624 if ((!chosen_desc->text.max_y) && maxh && (*maxh > -1))
1625 {
1626 /* text.min: 1 1
1627 * text.max: 0 0
1628 * There is limit for height. */
1629 temp_h = *maxh;
1630 }
1631
1632 efl_gfx_size_set(ep->object, temp_w, temp_h);
1633 efl_canvas_text_size_formatted_get(ep->object, &tw, &th);
1634
1635 tw += ins_l + ins_r;
1636 th += ins_t + ins_b;
1637
1638 /* If base width for calculation is 0,
1639 * don't get meaningless height for multiline */
1640 if (temp_w <= 0)
1641 {
1642 efl_canvas_text_size_native_get(ep->object, NULL, &th);
1643
1644 th += ins_t + ins_b;
1645 }
1646 }
1647 else
1648 {
1649 /* text.min: 1 X
1650 * text.max: 1 X
1651 * Or,
1652 * text.min: 1 X
1653 * text.max: 0 X without max width.
1654 * It is a singleline Textblock. */
1655 efl_canvas_text_size_native_get(ep->object, &tw, &th);
1656
1657 tw += ins_l + ins_r;
1658 th += ins_t + ins_b;
1659
1660 if (!chosen_desc->text.max_x &&
1661 (maxw && (*maxw > -1) && (*maxw < tw)))
1662 {
1663 /* text.min: 1 0
1664 * text.max: 0 X */
1665 tw = *maxw;
1666 }
1667 }
1668 }
1669
1670 if (tw > min_calc_w) min_calc_w = tw;
1671 if (th > min_calc_h) min_calc_h = th;
1672 if (chosen_desc->text.min_x && minw) *minw = min_calc_w;
1673 if (chosen_desc->text.min_y && minh) *minh = min_calc_h;
1674 }
1675
1676 if ((chosen_desc->text.max_x) || (chosen_desc->text.max_y))
1677 {
1678 evas_object_textblock_style_insets_get(ep->object, &ins_l, &ins_r,
1679 &ins_t, &ins_b);
1680
1681 tw = th = 0;
1682 if (!chosen_desc->text.max_x)
1683 {
1684 /* text.min: X X
1685 * text.max: 0 1 */
1686 int temp_w, temp_h;
1687
1688 if (chosen_desc->text.min_y)
1689 {
1690 /* text.min: X 1
1691 * text.max: 0 1
1692 * Already calculated in text for height. */
1693 tw = TO_INT(params->eval.w);
1694 if (min_calc_w > tw)
1695 tw = min_calc_w;
1696
1697 th = min_calc_h;
1698 }
1699 else
1700 {
1701 /* text.min: X 0
1702 * text.max: 0 1 */
1703 temp_w = TO_INT(params->eval.w);
1704 temp_h = TO_INT(params->eval.h);
1705
1706 if (min_calc_w > temp_w)
1707 temp_w = min_calc_w;
1708 if (maxw && (*maxw > -1) && (*maxw < temp_w))
1709 temp_w = *maxw;
1710 if (min_calc_h > temp_h)
1711 temp_h = min_calc_h;
1712
1713 /* If base width for calculation is 0,
1714 * don't get meaningless height for multiline */
1715 if (temp_w > 0)
1716 {
1717 efl_gfx_size_set(ep->object, temp_w, temp_h);
1718 efl_canvas_text_size_formatted_get(ep->object, &tw, &th);
1719
1720 tw += ins_l + ins_r;
1721 th += ins_t + ins_b;
1722 }
1723 else
1724 {
1725 efl_canvas_text_size_native_get(ep->object, NULL, &th);
1726
1727 th += ins_t + ins_b;
1728 }
1729 }
1730 }
1731 else
1732 {
1733 /* text.max: 1 X */
1734 if (chosen_desc->text.min_x)
1735 {
1736 /* text.min: 1 X
1737 * text.max: 1 X
1738 * Singleline. */
1739 efl_canvas_text_size_native_get(ep->object, &tw, &th);
1740
1741 tw += ins_l + ins_r;
1742 th += ins_t + ins_b;
1743 }
1744 else
1745 {
1746 /* text.min: 0 X
1747 * text.max: 1 X */
1748 if (chosen_desc->text.max_y)
1749 {
1750 /* text.min: 0 X
1751 * text.max: 1 1 */
1752 int temp_w, temp_h;
1753
1754 temp_w = TO_INT(params->eval.w);
1755 temp_h = TO_INT(params->eval.h);
1756
1757 if (min_calc_w > temp_w)
1758 temp_w = min_calc_w;
1759 if (min_calc_h > temp_h)
1760 temp_h = min_calc_h;
1761
1762 if (chosen_desc->text.min_y)
1763 {
1764 /* text.min: 0 1
1765 * text.max: 1 1
1766 * There is no need to calculate it again. */
1767 tw = min_calc_w;
1768 th = min_calc_h;
1769 }
1770 else
1771 {
1772 /* text.min: 0 0
1773 * text.max: 1 1 */
1774
1775 efl_gfx_size_set(ep->object, temp_w, temp_h);
1776 efl_canvas_text_size_formatted_get(ep->object, &tw, &th);
1777
1778 tw += ins_l + ins_r;
1779 th += ins_t + ins_b;
1780
1781 /* If base width for calculation is 0,
1782 * don't get meaningless height for multiline */
1783 if (temp_w <= 0)
1784 {
1785 efl_canvas_text_size_native_get(ep->object, NULL, &th);
1786
1787 th += ins_t + ins_b;
1788 }
1789 }
1790 }
1791 else
1792 {
1793 /* text.min: 0 X
1794 * text.max: 1 0 */
1795 int temp_w, temp_h;
1796
1797 temp_w = TO_INT(params->eval.w);
1798 if (min_calc_w > temp_w)
1799 temp_w = min_calc_w;
1800
1801 efl_gfx_size_get(ep->object, NULL, &temp_h);
1802 efl_gfx_size_set(ep->object, temp_w, temp_h);
1803 efl_canvas_text_size_formatted_get(ep->object, &tw, &th);
1804
1805 tw += ins_l + ins_r;
1806 th += ins_t + ins_b;
1807
1808 /* If base width for calculation is 0,
1809 * don't get meaningless height for multiline */
1810 if (temp_w <= 0)
1811 {
1812 efl_canvas_text_size_native_get(ep->object, NULL, &th);
1813
1814 th += ins_t + ins_b;
1815 }
1816 }
1817 }
1818 }
1819
1820 if (maxw && chosen_desc->text.max_x)
1821 {
1822 if (tw > *maxw) *maxw = tw;
1823 if (minw && (*maxw < *minw)) *maxw = *minw;
1824 }
1825 if (maxh && chosen_desc->text.max_y)
1826 {
1827 if (th > *maxh) *maxh = th;
1828 if (minh && (*maxh < *minh)) *maxh = *minh;
1829 }
1830 }
1831}
1832
1470static void 1833static void
1471_edje_part_recalc_single_textblock(FLOAT_T sc, 1834_edje_part_recalc_single_textblock(FLOAT_T sc,
1472 Edje *ed, 1835 Edje *ed,
@@ -1476,20 +1839,13 @@ _edje_part_recalc_single_textblock(FLOAT_T sc,
1476 int *minw, int *minh, 1839 int *minw, int *minh,
1477 int *maxw, int *maxh) 1840 int *maxw, int *maxh)
1478{ 1841{
1479 int min_calc_w = 0, min_calc_h = 0;
1480
1481 if ((ep->type != EDJE_RP_TYPE_TEXT) || 1842 if ((ep->type != EDJE_RP_TYPE_TEXT) ||
1482 (!ep->typedata.text)) 1843 (!ep->typedata.text))
1483 return; 1844 return;
1484 1845
1485 /* min_calc_* values need to save calculated minumum size
1486 * for maximum size calculation */
1487 if (minw) min_calc_w = *minw;
1488 if (minh) min_calc_h = *minh;
1489
1490 if (chosen_desc) 1846 if (chosen_desc)
1491 { 1847 {
1492 Evas_Coord tw, th, ins_l, ins_r, ins_t, ins_b; 1848 Evas_Coord tw, th;
1493 const char *text = ""; 1849 const char *text = "";
1494 const char *style = ""; 1850 const char *style = "";
1495 Edje_Style *stl = NULL; 1851 Edje_Style *stl = NULL;
@@ -1629,279 +1985,22 @@ _edje_part_recalc_single_textblock(FLOAT_T sc,
1629 { 1985 {
1630 evas_object_textblock_text_markup_set(ep->object, text); 1986 evas_object_textblock_text_markup_set(ep->object, text);
1631 } 1987 }
1632 if ((chosen_desc->text.min_x) || (chosen_desc->text.min_y))
1633 {
1634 evas_object_textblock_style_insets_get(ep->object, &ins_l,
1635 &ins_r, &ins_t, &ins_b);
1636
1637 tw = th = 0;
1638 if (!chosen_desc->text.min_x)
1639 {
1640 /* text.min: 0 1
1641 * text.max: X X */
1642 int temp_h = TO_INT(params->eval.h);
1643 int temp_w = TO_INT(params->eval.w);
1644 1988
1645 if (min_calc_w > temp_w) 1989 if ((ed->file->efl_version.major >= 1) && (ed->file->efl_version.minor >= 19))
1646 temp_w = min_calc_w; 1990 {
1647 if ((!chosen_desc->text.max_x) && 1991 _edje_part_recalc_single_textblock_min_max_calc(ep,
1648 maxw && (*maxw > -1) && (*maxw < temp_w)) 1992 chosen_desc,
1649 temp_w = *maxw; 1993 params,
1650 1994 minw, minh,
1651 if (chosen_desc->text.max_y) 1995 maxw, maxh);
1652 {
1653 /* text.min: 0 1
1654 * text.max: X 1 */
1655 temp_h = INT_MAX / 10000;
1656 }
1657 else if (maxh && (*maxh > TO_INT(params->eval.h)))
1658 {
1659 /* text.min: 0 1
1660 * text.max: X 0
1661 * And there is a limit for height. */
1662 temp_h = *maxh;
1663 }
1664
1665 /* If base width for calculation is 0,
1666 * don't get meaningless height for multiline */
1667 if (temp_w > 0)
1668 {
1669 efl_gfx_size_set(ep->object, temp_w, temp_h);
1670 efl_canvas_text_size_formatted_get(ep->object, &tw, &th);
1671
1672 tw += ins_l + ins_r;
1673 th += ins_t + ins_b;
1674 }
1675 else
1676 {
1677 efl_canvas_text_size_native_get(ep->object, NULL, &th);
1678
1679 th += ins_t + ins_b;
1680 }
1681 }
1682 else
1683 {
1684 /* text.min: 1 X
1685 * text.max: X X */
1686 if (chosen_desc->text.min_y && (!chosen_desc->text.max_x) &&
1687 maxw && (*maxw > -1))
1688 {
1689 /* text.min: 1 1
1690 * text.max: 0 X */
1691 int temp_w, temp_h;
1692
1693 temp_w = *maxw;
1694 temp_h = INT_MAX / 10000;
1695
1696 if (min_calc_w > temp_w)
1697 temp_w = min_calc_w;
1698
1699 if ((!chosen_desc->text.max_y) && maxh && (*maxh > -1))
1700 {
1701 /* text.min: 1 1
1702 * text.max: 0 0
1703 * There is limit for height. */
1704 temp_h = *maxh;
1705 }
1706
1707 efl_gfx_size_set(ep->object, temp_w, temp_h);
1708 efl_canvas_text_size_formatted_get(ep->object, &tw, &th);
1709
1710 tw += ins_l + ins_r;
1711 th += ins_t + ins_b;
1712
1713 /* If base width for calculation is 0,
1714 * don't get meaningless height for multiline */
1715 if (temp_w <= 0)
1716 {
1717 efl_canvas_text_size_native_get(ep->object, NULL, &th);
1718
1719 th += ins_t + ins_b;
1720 }
1721 }
1722 else
1723 {
1724 /* text.min: 1 X
1725 * text.max: 1 X
1726 * Or,
1727 * text.min: 1 X
1728 * text.max: 0 X without max width.
1729 * It is a singleline Textblock. */
1730 efl_canvas_text_size_native_get(ep->object, &tw, &th);
1731
1732 tw += ins_l + ins_r;
1733 th += ins_t + ins_b;
1734
1735 if (!chosen_desc->text.max_x &&
1736 (maxw && (*maxw > -1) && (*maxw < tw)))
1737 {
1738 /* text.min: 1 0
1739 * text.max: 0 X */
1740 tw = *maxw;
1741 }
1742 }
1743 }
1744
1745 if (tw > min_calc_w) min_calc_w = tw;
1746 if (th > min_calc_h) min_calc_h = th;
1747 if (chosen_desc->text.min_x && minw) *minw = min_calc_w;
1748 if (chosen_desc->text.min_y && minh) *minh = min_calc_h;
1749 } 1996 }
1750 1997 else
1751 if ((chosen_desc->text.max_x) || (chosen_desc->text.max_y))
1752 { 1998 {
1753 evas_object_textblock_style_insets_get(ep->object, &ins_l, &ins_r, 1999 _edje_part_recalc_single_textblock_min_max_calc_legacy(ep,
1754 &ins_t, &ins_b); 2000 chosen_desc,
1755 2001 params,
1756 tw = th = 0; 2002 minw, minh,
1757 if (!chosen_desc->text.max_x) 2003 maxw, maxh);
1758 {
1759 /* text.min: X X
1760 * text.max: 0 1 */
1761 int temp_w, temp_h;
1762
1763 if (chosen_desc->text.min_y)
1764 {
1765 /* text.min: X 1
1766 * text.max: 0 1
1767 * Already calculated in text for height. */
1768 tw = TO_INT(params->eval.w);
1769 if (min_calc_w > tw)
1770 tw = min_calc_w;
1771
1772 th = min_calc_h;
1773 }
1774 else
1775 {
1776 /* text.min: X 0
1777 * text.max: 0 1 */
1778 temp_w = TO_INT(params->eval.w);
1779 temp_h = TO_INT(params->eval.h);
1780
1781 if (min_calc_w > temp_w)
1782 temp_w = min_calc_w;
1783 if (maxw && (*maxw > -1) && (*maxw < temp_w))
1784 temp_w = *maxw;
1785 if (min_calc_h > temp_h)
1786 temp_h = min_calc_h;
1787
1788 /* If base width for calculation is 0,
1789 * don't get meaningless height for multiline */
1790 if (temp_w > 0)
1791 {
1792 efl_gfx_size_set(ep->object, temp_w, temp_h);
1793 efl_canvas_text_size_formatted_get(ep->object, &tw, &th);
1794
1795 tw += ins_l + ins_r;
1796 th += ins_t + ins_b;
1797 }
1798 else
1799 {
1800 efl_canvas_text_size_native_get(ep->object, NULL, &th);
1801
1802 th += ins_t + ins_b;
1803 }
1804 }
1805 }
1806 else
1807 {
1808 /* text.max: 1 X */
1809 if (chosen_desc->text.min_x)
1810 {
1811 /* text.min: 1 X
1812 * text.max: 1 X
1813 * Singleline. */
1814 efl_canvas_text_size_native_get(ep->object, &tw, &th);
1815
1816 tw += ins_l + ins_r;
1817 th += ins_t + ins_b;
1818 }
1819 else
1820 {
1821 /* text.min: 0 X
1822 * text.max: 1 X */
1823 if (chosen_desc->text.max_y)
1824 {
1825 /* text.min: 0 X
1826 * text.max: 1 1 */
1827 int temp_w, temp_h;
1828
1829 temp_w = TO_INT(params->eval.w);
1830 temp_h = TO_INT(params->eval.h);
1831
1832 if (min_calc_w > temp_w)
1833 temp_w = min_calc_w;
1834 if (min_calc_h > temp_h)
1835 temp_h = min_calc_h;
1836
1837 if (chosen_desc->text.min_y)
1838 {
1839 /* text.min: 0 1
1840 * text.max: 1 1
1841 * There is no need to calculate it again. */
1842 tw = min_calc_w;
1843 th = min_calc_h;
1844 }
1845 else
1846 {
1847 /* text.min: 0 0
1848 * text.max: 1 1 */
1849
1850 efl_gfx_size_set(ep->object, temp_w, temp_h);
1851 efl_canvas_text_size_formatted_get(ep->object, &tw, &th);
1852
1853 tw += ins_l + ins_r;
1854 th += ins_t + ins_b;
1855
1856 /* If base width for calculation is 0,
1857 * don't get meaningless height for multiline */
1858 if (temp_w <= 0)
1859 {
1860 efl_canvas_text_size_native_get(ep->object, NULL, &th);
1861
1862 th += ins_t + ins_b;
1863 }
1864 }
1865 }
1866 else
1867 {
1868 /* text.min: 0 X
1869 * text.max: 1 0 */
1870 int temp_w, temp_h;
1871
1872 temp_w = TO_INT(params->eval.w);
1873 if (min_calc_w > temp_w)
1874 temp_w = min_calc_w;
1875
1876 efl_gfx_size_get(ep->object, NULL, &temp_h);
1877 efl_gfx_size_set(ep->object, temp_w, temp_h);
1878 efl_canvas_text_size_formatted_get(ep->object, &tw, &th);
1879
1880 tw += ins_l + ins_r;
1881 th += ins_t + ins_b;
1882
1883 /* If base width for calculation is 0,
1884 * don't get meaningless height for multiline */
1885 if (temp_w <= 0)
1886 {
1887 efl_canvas_text_size_native_get(ep->object, NULL, &th);
1888
1889 th += ins_t + ins_b;
1890 }
1891 }
1892 }
1893 }
1894
1895 if (maxw && chosen_desc->text.max_x)
1896 {
1897 if (tw > *maxw) *maxw = tw;
1898 if (minw && (*maxw < *minw)) *maxw = *minw;
1899 }
1900 if (maxh && chosen_desc->text.max_y)
1901 {
1902 if (th > *maxh) *maxh = th;
1903 if (minh && (*maxh < *minh)) *maxh = *minh;
1904 }
1905 } 2004 }
1906 } 2005 }
1907 2006