§
    õŽ’jY  ã                   ó.   — d Z ddlmZmZmZ dd„Zdd„ZdS )zE
Helper module for the *bbox_inches* parameter in `.Figure.savefig`.
é    )ÚBboxÚTransformedBboxÚAffine2DNc                 óT  ‡ ‡‡‡‡‡‡— ‰ j         Š‰ j        Š‰ j        j        Šg Šg Št	          ¦   «         Š‰ j        D ]Î}|                     ¦   «         }|�|                      |||¦  «        ¦  «         ‰                     |¦  «         | 	                    d¬¦  «         
                    ¦   «         }|                     |fd„¦  «         d|j        v r‰                     |j        ¦  «         n‰                     ‰¦  «         d	d„|_        ŒÏˆˆ ˆˆˆˆˆfd„}|€‰ j        }t          ¦   «                              |¦  «        }|‰ j        z  }	t!          j        ddg|j        ¢R Ž ‰ _        |                     |j        ¦  «        \  }
}‰ j         j        |	z  \  }}t!          j        |
 | ||¦  «        ‰ j        _        ‰ j                             ¦   «          t-          ‰ j        |¦  «        ‰ _         ‰ j                             |
|z  ||z  ‰ j         j        |z  ‰ j         j        |z  ¦  «         |S )
aO  
    Temporarily adjust the figure so that only the specified area
    (bbox_inches) is saved.

    It modifies fig.bbox, fig.bbox_inches,
    fig.transFigure._boxout, and fig.patch.  While the figure size
    changes, the scale of the original figure is conserved.  A
    function which restores the original values are returned.
    NF)Úoriginalc                 ó   — |S ©N© )ÚaÚrÚ_poss      úDC:\Projects\DSCons\.venv\Lib\site-packages\matplotlib\_tight_bbox.pyú<lambda>zadjust_bbox.<locals>.<lambda>   s   € ¸4€ ó    Úapply_aspectc                 ó   — d S r	   r
   )Úposs    r   r   zadjust_bbox.<locals>.<lambda>%   s   € ¨4€ r   c                  ó(  •— t          ‰j        ‰‰¦  «        D ])\  } }}|                      |¦  «         |‰	u r| `Œ"|| _        Œ*‰‰_        ‰‰_        ‰‰j        _        ‰j                             ¦   «          ‰j	         
                    dddd¦  «         d S )Nr   é   )ÚzipÚaxesÚset_axes_locatorr   ÚbboxÚbbox_inchesÚtransFigureÚ_boxoutÚ
invalidateÚpatchÚ
set_bounds)
ÚaxÚlocÚaspectr   ÚfigÚlocator_listÚ
old_aspectÚorigBboxÚorigBboxInchesÚsentinels
      €€€€€€€r   Úrestore_bboxz!adjust_bbox.<locals>.restore_bbox'   s£   ø€ Ý" 3¤8¨\¸:ÑFÔFð 	)ð 	)‰OˆB��VØ×Ò Ñ$Ô$Ð$Ø˜Ð!Ð!à�O�Oà"(�”�àˆŒØ(ˆŒØ")ˆŒÔØŒ×"Ò"Ñ$Ô$Ð$ØŒ	×Ò˜Q  1 aÑ(Ô(Ð(Ð(Ð(r   r   r	   )r   r   r   r   Úobjectr   Úget_axes_locatorr   ÚappendÚget_positionÚfrozenr   Ú__dict__Údpir   Úscaler   Úfrom_boundsÚsizeÚ	transformÚp0r   r   r   r   ÚwidthÚheight)r#   r   ÚrendererÚ	fixed_dpir    ÚlocatorÚcurrent_posr)   ÚtrÚ	dpi_scaleÚx0Úy0Úw1Úh1r   r$   r%   r&   r'   r(   s   `             @@@@@@r   Úadjust_bboxrB      sT  øøøøøøø€ ð Œx€HØ”_€NØŒoÔ%€Gà€JØ€LÝ‰xŒx€HØŒhð 0ð 0ˆØ×%Ò%Ñ'Ô'ˆØÐØ�OŠO˜G˜G B¨Ñ1Ô1Ñ2Ô2Ð2Ø×Ò˜GÑ$Ô$Ð$Ø—o’o¨u�oÑ5Ô5×<Ò<Ñ>Ô>ˆØ
×Ò¨kÐ?Ð?Ð?Ñ@Ô@Ð@à˜Rœ[Ð(Ð(Ø×Ò˜bœoÑ.Ô.Ð.Ð.à×Ò˜hÑ'Ô'Ð'Ø/Ð/Ð/ˆŒˆð)ð )ð )ð )ð )ð )ð )ð )ð )ð )ð )ð ÐØ”Gˆ	Ý	‰Œ×	Ò	˜)Ñ	$Ô	$€BØ˜CœGÑ#€IåÔ& q¨!Ð?¨kÔ.>Ð?Ð?Ð?€C„OØ�\Š\˜+œ.Ñ)Ô)�F€BˆØŒXŒ]˜YÑ&�F€BˆÝ"Ô.°¨s°R°C¸¸RÑ@Ô@€C„OÔØ„O×ÒÑ Ô Ð å˜sœ°Ñ3Ô3€C„Hà„I×Ò˜˜b™ " r¡'Øœœ¨"Ñ,¨c¬h¬oÀÑ.BñDô Dð Dð Ðr   c                 óL   — |\  }} |¦   «          t          | |||¦  «        }||fS )z­
    A function that needs to be called when figure dpi changes during the
    drawing (e.g., rasterizing).  It recovers the bbox and re-adjust it with
    the new dpi.
    )rB   )r#   Úbbox_inches_restorer8   r9   r   r)   r   s          r   Úprocess_figure_for_rasterizingrE   I   s6   € ð !4Ñ€K�Ø€L�N„N€NÝ�C˜ h°	Ñ:Ô:€Aà˜ˆ>Ðr   r	   )Ú__doc__Úmatplotlib.transformsr   r   r   rB   rE   r
   r   r   ú<module>rH      sc   ððð ð BÐ AÐ AÐ AÐ AÐ AÐ AÐ AÐ AÐ Að>ð >ð >ð >ðBð ð ð ð ð r   