%PDF- %PDF-
Mini Shell

Mini Shell

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

�

��di��8�dZdZddlmZddlmZGd�d�Zy)z3.3.0z�
PDFPathObject is an efficient way to draw paths on a Canvas. Do not
instantiate directly, obtain one from the Canvas instead.

Progress Reports:
8.83, 2000-01-13, gmcm: created from pdfgen.py

�)�pdfgeom)�fp_strc�l�eZdZdZdd�Zd�Zd�Zd�Zd�Zd�Z	dd	�Z
dd
�Zd�Zd�Z
dd
�Zd�Zd�Zd�Zy)�
PDFPathObjecta:Represents a graphic path.  There are certain 'modes' to PDF
    drawing, and making a separate object to expose Path operations
    ensures they are completed with no run-time overhead.  Ask
    the Canvas for a PDFPath with getNewPathObject(); moveto/lineto/
    curveto wherever you want; add whole shapes; and then add it back
    into the canvas with one of the relevant operators.

    Path objects are probably not long, so we pack onto one line

    the code argument allows a canvas to get the operations appended directly so
    avoiding the final getCode
    Nc�B�|gf|du|_|j|_y�N)�_code�_init_code_append�_code_append)�self�codes  �=/usr/lib/python3/dist-packages/reportlab/pdfgen/pathobject.py�__init__zPDFPathObject.__init__s$���2�Y�t�t�|�,��
� �2�2���c��|jd�s|jd�sJd��|jj}|d�||�||_y)Nz mz rez%path must start with a moveto or rect�n)�endswithr	�appendr)r�c�code_appends   rr
zPDFPathObject._init_code_append#sK���z�z�$��1�:�:�e�#4�]�6]�]�4��j�j�'�'���C���A��'��rc�8�dj|j�S)z#pack onto one line; used internally� )�joinr	�rs r�getCodezPDFPathObject.getCode*s���x�x��
�
�#�#rc�@�|jdt||�z�y)Nz%s m�rr�r�x�ys   r�moveTozPDFPathObject.moveTo.������&�6�!�A�;�.�/rc�@�|jdt||�z�y)Nz%s lrrs   r�lineTozPDFPathObject.lineTo1r"rc�H�|jdt||||||�z�y)Nz%s cr)r�x1�y1�x2�y2�x3�y3s       r�curveTozPDFPathObject.curveTo4s$�����&�6�"�b�"�b�"�b�#A�A�Brc
�V�|jtj||||||��y)a�Contributed to piddlePDF by Robert Kern, 28/7/99.
        Draw a partial ellipse inscribed within the rectangle x1,y1,x2,y2,
        starting at startAng degrees and covering extent degrees.   Angles
        start with 0 to the right (+x) and increase counter-clockwise.
        These should have x1<x2 and y1<y2.

        The algorithm is an elliptical generalization of the formulae in
        Jim Fitzsimmon's TeX tutorial <URL: http://www.tinaja.com/bezarc1.pdf>.N��_curvesr�	bezierArc�rr&r'r(r)�startAng�extents       r�arczPDFPathObject.arc7s%��	
���W�&�&�r�"�b��X�v�F�Grc
�X�|jtj||||||�d�y)zmLike arc, but draws a line from the current point to
        the start if the start is not the current point.r$Nr.r1s       r�arcTozPDFPathObject.arcToCs'��	
���W�&�&�r�"�b��X�v�F�x�Prc	�F�|jdt||||f�z�y)zAdds a rectangle to the pathz%s reNr�rrr �width�heights     r�rectzPDFPathObject.rectHs#�����'�F�A�q�%��+@�$A�A�Brc
�b�|jtj||||z||zdd��y)zadds an ellipse to the pathrihNr.r8s     r�ellipsezPDFPathObject.ellipseLs+�����W�&�&�q�!�Q��Y�q�6�z�1�c�J�Krc�`�t||�|ddd�|D]}|j|dd��y)Nr�)�getattrr,)r�curves�initial�curves    rr/zPDFPathObject._curvesPs@�����W��v�a�y��!�}�-��	%�E��D�L�L�%���)�$�	%rc�N�||z
}||z
}d|zx}}|j||||�y)zadds a circle to the pathr?N)r=)r�x_cen�y_cen�rr&r'r9r:s        r�circlezPDFPathObject.circleUs4��
�Q�Y��
�Q�Y���1��������R��U�F�+rc
��d}|||zf}t|�t|�}}|||zf}	t|	�t|	�}	}
t|ttf��r|D�cgc]}td|���c}}t|�dkr|dt|�z
dgzz
}|j
||dz|
�|j||dz
|
�|ddkDr*||dz}|j||z
|
||
|z||
|dz�|j||	|dz
�|ddkDr*||dz}|j||	|z
||z
|	||dz
|	�|j||dz|	�|ddkDr*||dz}|j||z|	||	|z
||	|dz
�|j||
|dz�|ddkD�r||dz}|j||
|z||z|
||dz|
�n�||z}|j
||z|
�|j||z
|
�|j||z
|
||
|z||
|z�|j||	|z
�|j||	|z
||z
|	||z
|	�|j||z|	�|j||z|	||	|z
||	|z
�|j||
|z�|j||
|z||z|
||z|
�|j�ycc}w)z{Draws a rectangle with rounded corners. The corners are
        approximately quadrants of a circle, with the given radius.gW[����?r�r?��N)
�min�max�
isinstance�list�tuple�lenr!r$r,�close)
rrr r9r:�radius�m�xhi�xlo�yhi�ylorG�ts
             r�	roundRectzPDFPathObject.roundRect\s���
����%��i���s�8�S��X�S����&��j���s�8�S��X�S���f�d�5�\�*�#)�*�a��Q�q��*�A��1�v�a�x��q��Q��x�!��n�,���K�K��a��d�
�C�(��K�K��a��d�
�C�(���t�A�v��a��d�F�����S�1�W�c�3��a���c�A�a�D�j�I��K�K��S�1�Q�4�Z�(���t�A�v��a��d�F�����S�#��'�3��7�C��q��t��S�I��K�K��a��d�
�C�(���t�A�v��a��d�F�����S�1�W�c�3��a���c�A�a�D�j�I��K�K��S�1�Q�4�Z�(���t�A�v��a��d�F�����S�#��'�3��7�C��q��t��S�I��F�
�A��K�K��f��c�*��K�K��f��c�*��L�L��q��#�s�C�!�G�S�#��,�G��K�K��S�6�\�*��L�L��c�A�g�s�Q�w��S�6�\�3�G��K�K��f��c�*��L�L��q��#�s�C�!�G�S�#��,�G��K�K��S�6�\�*��L�L��c�A�g�s�Q�w��S�6�\�3�G��
�
���?+s�Kc�&�|jd�y)z%draws a line back to where it started�hN)rrs rrSzPDFPathObject.close�s�����#�rr)r�Z)r!)�__name__�
__module__�__qualname__�__doc__rr
rr!r$r,r4r6r;r=r/rHr[rS�rrrrsS���3�(�$�0�0�C�
H�Q�
C�L�%�
,�+�ZrrN)�__version__rb�reportlab.pdfgenr�reportlab.lib.rl_accelrrrcrr�<module>rgs'��
��	��%�)�y�yr

Zerion Mini Shell 1.0