Ë
    íÍ:j  ã                   ó,   — d Z ddlmZmZmZ dd„Zdd„Zy)zE
Helper module for the *bbox_inches* parameter in `.Figure.savefig`.
é    )ÚBboxÚTransformedBboxÚAffine2DNc                 ó¶  ‡ ‡‡‡‡‡‡— ‰ j                   Š‰ j                  Š‰ j                  j                  Šg Šg Št	        «       Š‰ j
                  D ]µ  }|j                  «       }|�|j                   |||«      «       ‰j                  |«       |j                  d¬«      j                  «       }|j                  |fd„«       d|j                  v r‰j                  |j                  «       n‰j                  ‰«       dd„|_        Œ· ˆˆ ˆˆˆˆˆfd„}|€‰ j                  }t        «       j                  |«      }|‰ j                  z  }	t!        j"                  ddg|j$                  ¢­Ž ‰ _        |j'                  |j(                  «      \  }
}‰ j                   j$                  |	z  \  }}t!        j"                  |
 | ||«      ‰ j                  _        ‰ j                  j+                  «        t-        ‰ j                  |«      ‰ _         ‰ j.                  j1                  |
|z  ||z  ‰ j                   j2                  |z  ‰ j                   j4                  |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.
    F)Úoriginalc                 ó   — |S ©N© )ÚaÚrÚ_poss      úk/home/mcse/projects/srt_converter/srt-converter-venv/lib/python3.12/site-packages/matplotlib/_tight_bbox.pyú<lambda>zadjust_bbox.<locals>.<lambda>   s   € ¸4€ ó    Úapply_aspectc                  ó   — y r	   r
   )Úposs    r   r   zadjust_bbox.<locals>.<lambda>%   s   � r   c                  ó2  •— t        ‰j                  ‰‰«      D ]%  \  } }}| j                  |«       |‰	u r| `Œ|| _        Œ' ‰‰_        ‰‰_        ‰‰j                  _        ‰j                  j                  «        ‰j                  j                  dddd«       y )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¡8¨\¸:ÓFò 	)‰OˆB��VØ×Ñ Ô$Ø˜Ñ!à‘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      së  þ€ ð �x‰x€HØ—_‘_€NØ�o‰o×%Ñ%€Gà€JØ€LÜ‹x€HØ�h‰hò 0ˆØ×%Ñ%Ó'ˆØÐØ�O‰O™G B¨Ó1Ô2Ø×Ñ˜GÔ$Ø—o‘o¨u�oÓ5×<Ñ<Ó>ˆØ
×Ñ¨kÒ?Ô@à˜RŸ[™[Ñ(Ø×Ñ˜bŸo™oÕ.à×Ñ˜hÔ'Ú/ˆ�ð0÷)ò )ð ÐØ—G‘Gˆ	Ü	‹×	Ñ	˜)Ó	$€BØ˜CŸG™GÑ#€Iä×&Ñ& q¨!Ð?¨k×.>Ñ.>Ò?€C„OØ�\‰\˜+Ÿ.™.Ó)�F€BˆØ�X‰X�]‰]˜YÑ&�F€BˆÜ"×.Ñ.°¨s°R°C¸¸RÓ@€C‡O�OÔØ‡O�O×ÑÔ ä˜sŸ™°Ó3€C„Hà‡I�I×Ñ˜˜b™ " r¡'ØŸ™Ÿ™¨"Ñ,¨c¯h©h¯o©oÀÑ.BôDð Ðr   c                 ó>   — |\  }} |«        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   s-   € ð !4Ñ€K�Ù„NÜ�C˜ h°	Ó:€Aà˜ˆ>Ðr   r	   )Ú__doc__Úmatplotlib.transformsr   r   r   rB   rE   r
   r   r   ú<module>rH      s   ðñ÷ BÑ Aó>ôBr   