%PDF- %PDF-
Direktori : /lib/python3/dist-packages/reportlab/lib/__pycache__/ |
Current File : //lib/python3/dist-packages/reportlab/lib/__pycache__/boxstuff.cpython-312.pyc |
� ��do � � � d Z dZdd�Zdd�Zy)z3.4.34z;Utility functions to position and resize boxes within boxesc �r � |dvr|dv r | |dz z } n| |z } |dvr|dv r ||dz z }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� @�r r �se)r r �e� )�x�y�width�height�anchor�dimss �8/usr/lib/python3/dist-packages/reportlab/lib/boxstuff.py� rectCornerr sj � � �_�$��]�"� ��r��M�A� ��J�A� �_�$��]�"� ����N�A� ��K�A�!%�A�a��f��0�A�a�5�0� c �x � d} |�|}|�|}|dk r| }||z }|dk r| }||z }| rht |� }t |� }t |t |� z |t |� z � } |} |}| |z dz }| |z dz }|st ||| |z ||z |� \ }}|r$|dvr||dv r|dz n|z }|dvr||dv r|dz n|z }||||| fS ) ah This 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 )r r r r r r )�abs�min�floatr )�preserver r r r r �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�$�$r N)r F)F)�__version__�__doc__r r% r r r �<module>r( s �� ��I�� 1�?%r