
    Q?hi                     8    S r SrSSKJr  SSKJr   " S S5      rg)z3.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                   |    \ rS rSrSrSS jrS rS rS rS r	S	 r
SS
 jrSS jrS rS rSS jrS rS rS rSrg)PDFPathObject   a  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    U/ 4US L    U l         U R                  U l        g N)_code_init_code_append_code_append)selfcodes     M/var/www/html/env/lib/python3.13/site-packages/reportlab/pdfgen/pathobject.py__init__PDFPathObject.__init__   s$    2Ytt|,
 22    c                     UR                  S5      (       d  UR                  S5      (       d   S5       eU R                  R                  nU" S5        U" U5        X l        g )Nz mz rez%path must start with a moveto or rectn)endswithr
   appendr   )r   ccode_appends      r   r   PDFPathObject._init_code_append#   sO    zz$1::e#4#4]6]]4jj''CA'r   c                 8    SR                  U R                  5      $ )z#pack onto one line; used internally )joinr
   r   s    r   getCodePDFPathObject.getCode*   s    xx

##r   c                 >    U R                  S[        X5      -  5        g )Nz%s mr   r   r   xys      r   moveToPDFPathObject.moveTo.       &6!;./r   c                 >    U R                  S[        X5      -  5        g )Nz%s lr!   r"   s      r   lineToPDFPathObject.lineTo1   r'   r   c                 B    U R                  S[        XX4XV5      -  5        g )Nz%s cr!   )r   x1y1x2y2x3y3s          r   curveToPDFPathObject.curveTo4   s    &6"""#AABr   c           
      R    U R                  [        R                  " XX4XV5      5        g)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   arcPDFPathObject.arc7   s     	W&&rbXFGr   c           
      T    U R                  [        R                  " XX4XV5      S5        g)zeLike arc, but draws a line from the current point to
the start if the start is not the current point.r)   Nr5   r8   s          r   arcToPDFPathObject.arcToC   s!     	W&&rbXFxPr   c           	      B    U R                  S[        XX445      -  5        g)zAdds a rectangle to the pathz%s reNr!   r   r#   r$   widthheights        r   rectPDFPathObject.rectH   s    'FA%+@$AABr   c           
      ^    U R                  [        R                  " XX-   X$-   SS5      5        g)zadds an ellipse to the pathr   ih  Nr5   rA   s        r   ellipsePDFPathObject.ellipseL   s%    W&&qQYqz1cJKr   c                 b    [        X5      " US   S S 6   U H  nU R                  " USS  6   M     g )Nr      )getattrr2   )r   curvesinitialcurves       r   r6   PDFPathObject._curvesP   s5    vay!}-ELL%)$ r   c                 D    X-
  nX#-
  nSU-  =pgU R                  XEXg5        g)zadds a circle to the pathrJ   N)rG   )r   x_ceny_cenrr,   r-   rB   rC   s           r   circlePDFPathObject.circleU   s*    YY1RU+r   c           
      `   SnXU-   4n[        U5      [        U5      pxX"U-   4n	[        U	5      [        U	5      p[        U[        [        45      (       Gao  U Vs/ s H  n[        SU5      PM     snn[        U5      S:  a  US[        U5      -
  S/-  -  nU R                  XS   -   U
5        U R                  X{S   -
  U
5        US   S:  a%  XkS   -  nU R                  X|-
  XX-   XzUS   -   5        U R                  XyUS   -
  5        US   S:  a&  XkS   -  nU R                  XyU-
  X|-
  XUS   -
  U	5        U R                  XS   -   U	5        US   S:  a%  XkS   -  nU R                  X-   XX-
  XUS   -
  5        U R                  XUS   -   5        US   S:  a&  XkS   -  nU R                  XU-   X-   XUS   -   U
5        OXe-  nU R                  X-   U
5        U R                  Xu-
  U
5        U R                  X|-
  XX-   XzU-   5        U R                  XyU-
  5        U R                  XyU-
  X|-
  XU-
  U	5        U R                  X-   U	5        U R                  X-   XX-
  XU-
  5        U R                  XU-   5        U R                  XU-   X-   XU-   U
5        U R                  5         gs  snf )zsDraws a rectangle with rounded corners. The corners are
approximately quadrants of a circle, with the given radius.gW[?r      rJ         N)
minmax
isinstancelisttuplelenr%   r)   r2   close)r   r#   r$   rB   rC   radiusmxhixloyhiylorS   ts                r   	roundRectPDFPathObject.roundRect\   s    %is8SXS&js8SXSfd5\**#)*6aQq6*A1vaxqQx!n,KKd
C(KKd
C(tAvdFSWcAaDjIKK1Q4Z(tAvdFS'37CqtSIKKd
C(tAvdFSWcAaDjIKK1Q4Z(tAvdFS'37CqtSI 
AKKc*KKc*LL#CGS,GKK6\*LLAgsw6\3GKKc*LL#CGS,GKK6\*LLAgsw6\3G

? +s   J+c                 &    U R                  S5        g)z%draws a line back to where it startedhN)r   r   s    r   r`   PDFPathObject.close   s    #r   )r
   r   r	   )r   Z   )r%   )__name__
__module____qualname____firstlineno____doc__r   r   r   r%   r)   r2   r;   r>   rD   rG   r6   rT   rh   r`   __static_attributes__ r   r   r   r      sS    3($00C
HQ
CL%
,+Zr   r   N)__version__rr   reportlab.pdfgenr   reportlab.lib.rl_accelr   r   rt   r   r   <module>rx      s'    	 % )y yr   