
    	h#	                     ,    S SK r S SKJr   " S S5      rg)    N)pixels_to_EMUc                       \ rS rSrSrSrS r\S 5       r\R                  S 5       r\S 5       r
\
R                  S 5       r
SS	 jr\S
 5       rSrg)Drawing	   za drawing object - eg container for shapes or charts
we assume user specifies dimensions in pixels; units are
converted to EMU in the drawing part
r   c                     SU l         SU l        SU l        SU l        SU l        SU l        SU l        SU l        SU l        SU l	        SU l
        SU l        g )N ))      )      r         Fabsolute)namedescriptioncoordinateslefttop_width_heightresize_proportionalrotation
anchortype	anchorcol	anchorrowselfs    J/var/www/html/env/lib/python3.13/site-packages/openpyxl/drawing/drawing.py__init__Drawing.__init__   sY    	,	#( $    c                     U R                   $ N)r   r   s    r   widthDrawing.width!   s    {{r!   c                     U R                   (       a2  U(       a+  U R                  U R                  -  n[        X!-  5      U l        Xl        g r#   )r   r   r   round)r   wratios      r   r$   r%   &   s2    ##LL4;;.E +DLr!   c                     U R                   $ r#   )r   r   s    r   heightDrawing.height.   s    ||r!   c                     U R                   (       a2  U(       a+  U R                  U R                  -  n[        X!-  5      U l        Xl        g r#   )r   r   r   r'   )r   hr)   s      r   r+   r,   3   s2    ##KK$,,.E	*DKr!   c                 Z   XR                   -  nX R                  -  nU R                  (       a~  U(       av  U(       an  X0R                  -  U:  a.  [        R                  " X0R                  -  5      U l        Xl         g [        R                  " X@R                   -  5      U l         X l        g g g g r#   )r   r   r   mathceil)r   r(   r.   xratioyratios        r   set_dimensionDrawing.set_dimension;   sw    [[\\!##a%*#yy,,)>?"ii(<=  /0#r!   c                    SSK JnJnJn  U R                  S:X  aP  U" 5       n[        U R                  5      UR                  l        [        U R                  5      UR                  l
        OMU R                  S:X  a=  U" 5       nU R                  UR                  l        U R                  UR                  l        [        U R                   5      WR"                  l        [        U R&                  5      UR"                  l        U$ )Nr	   )OneCellAnchorTwoCellAnchorAbsoluteAnchorr   oneCell)spreadsheet_drawingr7   r8   r9   r   r   r   posxr   yr   _fromcolr   rowr   extr$   r   r+   )r   r7   r8   r9   anchors        r   rC   Drawing.anchorI   s    	 	 ??j(#%F(3FJJL(2FJJL__	)"_F#~~FLL#~~FLL(5

)$,,7

r!   )r   r   r   r   r   r   r   r   r   r   r   r   N)r   r   )__name__
__module____qualname____firstlineno____doc__countr   propertyr$   setterr+   r4   rC   __static_attributes__ r!   r   r   r   	   s    
 E    \\    ]] !  r!   r   )r0   openpyxl.utils.unitsr   r   rN   r!   r   <module>rP      s     .S Sr!   