3
VÓmWî  ã               @   s0   d Z ddlmZmZ ddlZdd„ Zdd„ ZdS )zº
    weasyprint.layout.min_max
    -------------------------

    :copyright: Copyright 2011-2014 Simon Sapin and contributors, see AUTHORS.
    :license: BSD, see LICENSE for details.

é    )ÚdivisionÚunicode_literalsNc                s    t jˆ ƒ‡ fdd„ƒ}ˆ |_|S )zYDecorate a function that sets the used width of a box to handle
    {min,max}-width.
    c                sz   | j | jf}ˆ | f|žŽ }| j| jkrH| j| _|\| _ | _ˆ | f|žŽ }| j| jk rv| j| _|\| _ | _ˆ | f|žŽ }|S )N)Zmargin_leftZmargin_rightÚwidthÚ	max_widthZ	min_width)ÚboxÚargsÚcomputed_marginsÚresult)Úfunction© úY/var/www/html/enquirykeeper_venv/lib/python3.6/site-packages/weasyprint/layout/min_max.pyÚwrapper   s    z%handle_min_max_width.<locals>.wrapper)Ú	functoolsÚwrapsÚwithout_min_max)r
   r   r   )r
   r   Úhandle_min_max_width   s    r   c                s    t jˆ ƒ‡ fdd„ƒ}ˆ |_|S )z[Decorate a function that sets the used height of a box to handle
    {min,max}-height.
    c                sz   | j | jf}ˆ | f|žŽ }| j| jkrH| j| _|\| _ | _ˆ | f|žŽ }| j| jk rv| j| _|\| _ | _ˆ | f|žŽ }|S )N)Z
margin_topZmargin_bottomÚheightZ
max_heightZ
min_height)r   r   r   r	   )r
   r   r   r   (   s    z&handle_min_max_height.<locals>.wrapper)r   r   r   )r
   r   r   )r
   r   Úhandle_min_max_height$   s    r   )Ú__doc__Ú
__future__r   r   r   r   r   r   r   r   r   Ú<module>	   s   