MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / hlist_out

Function hlist_out

lib/matplotlib/_mathtext.py:1733–1798  ·  view source on GitHub ↗
(box: Hlist)

Source from the content-addressed store, hash-verified

1731 return -1e9 if value < -1e9 else +1e9 if value > +1e9 else value
1732
1733 def hlist_out(box: Hlist) -> None:
1734 nonlocal cur_v, cur_h
1735
1736 cur_g = 0
1737 cur_glue = 0.
1738 glue_order = box.glue_order
1739 glue_sign = box.glue_sign
1740 base_line = cur_v
1741 left_edge = cur_h
1742
1743 phantom.append(box.is_phantom)
1744
1745 for p in box.children:
1746 if isinstance(p, Char):
1747 render(p, output, cur_h + off_h, cur_v + off_v)
1748 cur_h += p.width
1749 elif isinstance(p, Kern):
1750 cur_h += p.width
1751 elif isinstance(p, List):
1752 # node623
1753 if len(p.children) == 0:
1754 cur_h += p.width
1755 else:
1756 edge = cur_h
1757 cur_v = base_line + p.shift_amount
1758 if isinstance(p, Hlist):
1759 hlist_out(p)
1760 elif isinstance(p, Vlist):
1761 # p.vpack(box.height + box.depth, 'exactly')
1762 vlist_out(p)
1763 else:
1764 assert False, "unreachable code"
1765 cur_h = edge + p.width
1766 cur_v = base_line
1767 elif isinstance(p, Box):
1768 # node624
1769 rule_height = p.height
1770 rule_depth = p.depth
1771 rule_width = p.width
1772 if np.isinf(rule_height):
1773 rule_height = box.height
1774 if np.isinf(rule_depth):
1775 rule_depth = box.depth
1776 if rule_height > 0 and rule_width > 0:
1777 cur_v = base_line + rule_depth
1778 render(p, output,
1779 cur_h + off_h, cur_v + off_v,
1780 rule_width, rule_height)
1781 cur_v = base_line
1782 cur_h += rule_width
1783 elif isinstance(p, Glue):
1784 # node625
1785 glue_spec = p.glue_spec
1786 rule_width = glue_spec.width - cur_g
1787 if glue_sign != 0: # normal
1788 if glue_sign == 1: # stretching
1789 if glue_spec.stretch_order == glue_order:
1790 cur_glue += glue_spec.stretch

Callers 2

vlist_outFunction · 0.85
shipFunction · 0.85

Calls 4

renderFunction · 0.85
vlist_outFunction · 0.85
clampFunction · 0.85
popMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…