%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/reportlab/lib/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/reportlab/lib/__pycache__/boxstuff.cpython-312.pyc

�

��do���dZdZdd�Zdd�Zy)z3.4.34z;Utility functions to position and resize boxes within boxesc�r�|dvr|dvr	||dzz
}n||z
}|dvr|dvr	||dzz
}n||z
}|r||||fS||fS)zegiven rectangle controlled by x,y width and height return 
    the corner corresponding to the anchor��nw�w�sw��n�c�s�@�rr
�se)rr	�e�)�x�y�width�height�anchor�dimss      �8/usr/lib/python3/dist-packages/reportlab/lib/boxstuff.py�
rectCornerrsj���_�$��]�"�
��r��M�A�
��J�A�
�_�$��]�"�
����N�A�
��K�A�!%�A�a��f��0�A�a�5�0�c	�x�d}	|�|}|�|}|dkr|}||z}|dkr|}||z}|rht|�}t|�}t|t|�z|t|�z�}	|}
|}|	|zdz
}|	|zdz
}|st|||
|z
||z
|�\}}|r$|dvr||dvr|dzn|z}|dvr||dvr|dzn|z}|||||	fS)	ahThis function helps position an image within a box.

    It first normalizes for two cases:
    - if the width is None, it assumes imWidth
    - ditto for height
    - if width or height is negative, it adjusts x or y and makes them positive

    Given
    (a) the enclosing box (defined by x,y,width,height where x,y is the         lower left corner) which you wish to position the image in, and
    (b) the image size (imWidth, imHeight), and
    (c) the 'anchor point' as a point of the compass - n,s,e,w,ne,se etc         and c for centre,

    this should return the position at which the image should be drawn,
    as well as a scale factor indicating what scaling has happened.

    It returns the parameters which would be used to draw the image
    without any adjustments:

        x,y, width, height, scale

    used in canvas.drawImage and drawInlineImage
    g�?�g:�0�yE>r)rr	rrrr)�abs�min�floatr)�preserverrrrr�imWidth�imHeight�
anchorAtXY�scale�owidth�oheights            r�aspectRatioFixr%s��2
�E��}���
�~����Q�w����	�U�
��
�a�x����	�V�����g�,���x�=���E�%��.�(���h��)?�@�������g�
�d�"���x���$����a��&��,�w�v�~�f�E�D�A�q����(�
�f�
�5����6�A�A���(�
�V�}�4��r��%�?�A��Q��v�u�$�$rN)rF)F)�__version__�__doc__rr%rrr�<module>r(s��
��I��
1�?%r

Zerion Mini Shell 1.0