Warning: session_start(): Session cannot be started after headers have already been sent in /home/tvrreohg/public_html/manga.php on line 13
3 ›tîaiã@s2dZdZddlmZddlmZGdd„dƒZdS)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@sˆeZdZdZd"dd„Zdd„Zdd„Zd d „Zd d „Zd d„Z d#dd„Z d$dd„Z dd„Z dd„Z d%dd„Zdd„Zdd„Zd d!„ZdS)&Ú 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 NcCs|gf|dk|_|j|_dS)N)Ú_codeÚ_init_code_appendÚ _code_append)ÚselfÚcode©r ú|jdƒs|jdƒstdƒ‚|jj}|dƒ||ƒ||_dS)Nz mz rez%path must start with a moveto or rectÚn)ÚendswithÚAssertionErrorrÚappendr)rÚcZ code_appendr r r r#s zPDFPathObject._init_code_appendcCs dj|jƒS)z#pack onto one line; used internallyú )Újoinr)rr r r ÚgetCode*szPDFPathObject.getCodecCs|jdt||ƒƒdS)Nz%s m)rr)rÚxÚyr r r ÚmoveTo.szPDFPathObject.moveTocCs|jdt||ƒƒdS)Nz%s l)rr)rrrr r r ÚlineTo1szPDFPathObject.lineToc Cs |jdt||||||ƒƒdS)Nz%s c)rr)rÚx1Úy1Úx2Úy2Zx3Zy3r r r ÚcurveTo4szPDFPathObject.curveToréZcCs|jtj||||||ƒƒdS)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.N)Ú_curvesrÚ bezierArc)rrrrrÚstartAngÚextentr r r Úarc7s zPDFPathObject.arccCs |jtj||||||ƒdƒdS)zmLike arc, but draws a line from the current point to the start if the start is not the current point.rN)rrr )rrrrrr!r"r r r ÚarcToCszPDFPathObject.arcTocCs|jdt||||fƒƒdS)zAdds a rectangle to the pathz%s reN)rr)rrrÚwidthÚheightr r r ÚrectHszPDFPathObject.rectcCs&|jtj||||||ddƒƒdS)zadds an ellipse to the pathrihN)rrr )rrrr%r&r r r ÚellipseLszPDFPathObject.ellipsercCs>t||ƒ|ddd…Žx|D]}|j|dd…Žq WdS)Nré)Úgetattrr)rZcurvesÚinitialZcurver r r rPs zPDFPathObject._curvescCs0||}||}d|}}|j||||ƒdS)zadds a circle to the pathr)N)r()rZx_cenZy_cenÚrrrr%r&r r r ÚcircleUs zPDFPathObject.circlec CsÀd}|||f}t|ƒt|ƒ}}|||f} t| ƒt| ƒ} } t|ttfƒ�rÜdd„|Dƒ} t| ƒdkr€| dt| ƒdg7} |j|| d| ƒ|j|| d| ƒ| ddkrä|| d} |j|| | || | || | dƒ|j|| | dƒ| ddk�r6|| d} |j|| | || | || d| ƒ|j|| d| ƒ| ddk�rˆ|| d} |j|| | || | || | dƒ|j|| | dƒ| ddk�r´|| d} |j|| | || | || d| ƒnØ||} |j||| ƒ|j||| ƒ|j|| | || | || |ƒ|j|| |ƒ|j|| | || | ||| ƒ|j||| ƒ|j|| | || | || |ƒ|j|| |ƒ|j|| | || | ||| ƒ|j ƒd S) z{Draws a rectangle with rounded corners. The corners are approximately quadrants of a circle, with the given radius.gW[±¿ìžÜ?cSsg|]}td|ƒ‘qS)r)Úmax)Ú.0r,r r r ú hsz+PDFPathObject.roundRect..érr)ééN) Úminr.Ú isinstanceÚlistÚtupleÚlenrrrÚclose) rrrr%r&ZradiusÚmZxhiZxloZyhiZylor,Útr r r Ú roundRect\sJ     $ $ $ &    zPDFPathObject.roundRectcCs|jdƒdS)z%draws a line back to where it startedÚhN)r)rr r r r9‰szPDFPathObject.close)N)rr)rr)r)Ú__name__Ú __module__Ú __qualname__Ú__doc__r rrrrrr#r$r'r(rr-r<r9r r r r rs    -rN)Ú __version__rAZreportlab.pdfgenrZreportlab.lib.rl_accelrrr r r r Ús