Ë
    £èh%  ã                   óÊ   — d dl mZmZ d dlmZmZmZ d dlmZm	Z	 d dl
mZ d dlmZ g d¢Zdeded	efd
„Zd„ Zdedee   fd„Zddedee   defd„Zddedefd„Zdededefd„Zy)é    )ÚIterableÚcast)ÚUVecÚVec2ÚBoundingBox2d)ÚLayoutÚ
Paperspace)Ú	DXFEntity)Úbbox)ÚcenterÚobjectsÚextentsÚwindowÚlayoutÚpointÚsizec                 ó0  — | j                   }|rˆ| j                  r0t        t        |«      «      }|j	                  |t        |«      «       y| j
                  r5t        t        | «      }|j                  t        |«      t        |«      «       yt        d«      ‚y)záResets the active viewport center of `layout` to the given `point`,
    argument `size` defines the width and height of the viewport.
    Replaces the current viewport configuration by a single window
    configuration.

    zunsupported layout typeN)
ÚdocÚis_modelspaceÚguess_heightr   Úset_modelspace_vportÚis_any_paperspacer   r	   Úreset_main_viewportÚ	TypeError)r   r   r   r   ÚheightÚpsps         ú*lib/python3.12/site-packages/ezdxf/zoom.pyr   r      sy   € ð �*‰*€CÙ
Ø×ÒÜ!¤$ t£*Ó-ˆFØ×$Ñ$ V¬T°%«[Õ9Ø×%Ò%Ü”z 6Ó*ˆCØ×#Ñ#¤D¨£K´°d³Õ<äÐ5Ó6Ð6ð ó    c                 óP   — | j                   }| j                  }t        |dz  |«      S )Ng       @)ÚxÚyÚmax)r   Úwidthr   s      r   r   r       s%   € Ø�F‰F€EØ�V‰V€Fäˆu�s‰{˜FÓ#Ð#r   Úentitiesc                 óð   ‡— t        | t        «      r| j                  «       Š‰�ˆfd„|D «       }t        j                  |d¬«      }|j
                  r%t        | |j                  |j                  |z  «       y y )Nc              3   ó,   •K  — | ]  }|‰usŒ|–— Œ y ­w©N© )Ú.0ÚeÚmain_viewports     €r   Ú	<genexpr>z#zoom_to_entities.<locals>.<genexpr>+   s   øè ø€ ÐF¡8˜a¨q¸Ò/Eœ¡8ùs   ƒ	�T)Úfast)Ú
isinstancer	   r+   r   r   Úhas_datar   r   )r   r$   Úfactorr   r+   s       @r   Úzoom_to_entitiesr1   '   sb   ø€ Ü�&œ*Ô%Ø×,Ñ,Ó.ˆØÐ$ÛF¡8ÓFˆHÜ�l‰l˜8¨$Ô/€GØ×ÒÜˆv�w—~‘~ w§|¡|°fÑ'<Õ=ð r   r0   c                 óN   ‡— | j                   Šˆfd„|D «       }t        | ||«       y)a'  Resets the active viewport limits of `layout` to the extents of the
    given `entities`. Only entities in the given `layout` are taken into
    account. The argument `factor` scales the viewport limits.
    Replaces the current viewport configuration by a single window
    configuration.

    c              3   óV   •K  — | ]   }|j                   j                  ‰k(  sŒ|–— Œ" y ­wr'   )ÚdxfÚowner)r)   r*   r5   s     €r   r,   zobjects.<locals>.<genexpr>:   s!   øè ø€ Ð;™(�Q a§e¡e§k¡k°UÓ&:Œq™(ùs   ƒ)¢)N)Ú
layout_keyr1   )r   r$   r0   Úcontentr5   s       @r   r   r   1   s&   ø€ ð ×Ñ€EÛ;™(Ó;€GÜ�V˜W fÕ-r   c                 ó   — t        | | |«       y)zðResets the active viewport limits of `layout` to the extents of all
    entities in this `layout`. The argument `factor` scales the viewport limits.
    Replaces the current viewport configuration by a single window
    configuration.

    N)r1   )r   r0   s     r   r   r   >   s   € ô �V˜V VÕ,r   Úp1Úp2c                 ó`   — t        ||g«      }t        | |j                  |j                  «       y)zÌResets the active viewport limits of `layout` to the lower left corner
    `p1` and the upper right corner `p2`.
    Replaces the current viewport configuration by a single window
    configuration.

    N)r   r   r   )r   r9   r:   r   s       r   r   r   H   s&   € ô ˜R ˜HÓ%€GÜ
ˆ6�7—>‘> 7§<¡<Õ0r   N)é   )Útypingr   r   Ú
ezdxf.mathr   r   r   Úezdxf.layoutsr   r	   Úezdxf.entitiesr
   Úezdxfr   Ú__all__r   r   r1   Úfloatr   r   r   r(   r   r   Ú<module>rD      s¡   ð÷ "ç 0Ñ 0ß ,Ý $Ý â
4€ð7�6ð 7 $ð 7¨dó 7ò&$ð>˜Vð >¨x¸	Ñ/Bó >ñ
.�Fð 
. h¨yÑ&9ð 
.À5ó 
.ñ-�Fð - Eó -ð1�6ð 1˜tð 1¨ô 1r   