| Server IP : 217.160.0.135 / Your IP : 216.73.217.85 Web Server : Apache System : Linux www 6.18.52-i1-ampere #1203 SMP Mon Sep 14 18:29:59 CEST 2026 aarch64 User : sws1074145052 ( 1074145052) PHP Version : 8.3.32 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /lib/python3/dist-packages/reportlab/lib/__pycache__/ |
Upload File : |
�
`�_o � � � d Z dZdd�Zdd�ZdS ) z3.4.34z;Utility functions to position and resize boxes within boxes�swFc �r � |dvr|dv r | |dz z
} n| |z
} |dvr|dv r ||dz z
}n||z
}|r| |||fn| |fS )zegiven rectangle controlled by x,y width and height return
the corner corresponding to the anchor��nw�wr ��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 s} � � �_�$�$��]�"�"�
��r��M�A�A�
��J�A�
�_�$�$��]�"�"�
����N�A�A�
��K�A�!%�0�A�a��f���A�a�5�0� c � � d} |�|}|�|}|dk r| }||z }|dk r| }||z }| r�t |� � }t |� � }t |t |� � z |t |� � z � � } |}
|}| |z dz
}| |z dz
}|st |||
|z
||z
|� � \ }}|r$|dvr||dv r|dz n|z }|dvr||d v 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 �?N� 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% sM � �2
�E��}���
�~����Q�w�w���� �U�
��
�a�x�x���� �V���� F��g�,�,���x�=�=���E�%��.�.�(���h���)?�@�@�������g�
�d�"���x���$���
F� �a��&��,�w�v�~�f�E�E�D�A�q�� @���(�(�
�f�
�5�5�����6�A�A���(�(�
�V�}�4�4��r���%�?�A��Q��v�u�$�$r N)r F)F)�__version__�__doc__r r% r r r �<module>r( sC ��
��I��
1�
1�
1�
1�?%� ?%� ?%� ?%� ?%� ?%r