Ë
     #e3  ã                  óÀ   — d dl mZ d dlZd dlmZ d dlmZmZ d dlm	Z	m
Z
 d dlmZ d dlmZmZ d dlmZ d d	lmZ d d
lmZ ddlmZmZmZ ee G d„ d«      «       «       Zy)é    )ÚannotationsN)ÚOptional)ÚdefineÚfield)ÚIdentityÚ	Transform)ÚAbstractPen)ÚAbstractPointPenÚPointToSegmentPen)ÚBoundingBox)Úserde)ÚGlyphSeté   )Ú_convert_transformÚ	getBoundsÚgetControlBoundsc                  óv   — e Zd ZU dZded<   	  eee¬«      Zded<   	 dZ	ded	<   	 dd
„Z
dd„Zdd„Zdd„Zdd„Zy)Ú	Componenta)  Represents a reference to another glyph in the same layer.

    See http://unifiedfontobject.org/versions/ufo3/glyphs/glif/#component.

    Note:
        Components always refer to glyphs in the same layer. Referencing different
        layers is currently not possible in the UFO data model.
    ÚstrÚ	baseGlyph)ÚdefaultÚ	converterr   ÚtransformationNzOptional[str]Ú
identifierc           	     ój   — |\  }}| j                   \  }}}}}}	t        ||||||z   |	|z   «      | _         y)a  Moves this component by (x, y) font units.

        NOTE: This interprets the delta to be the visual delta, as in, it
        replaces the x and y offsets of the component's transformation
        directly, rather than going through
        :meth:`fontTools.misc.transform.Transform.translate`. Otherwise,
        composites that use flipped components (imagine a ``quotedblleft``
        composite using two x- and y-inverted ``comma`` components)
        would move in the opposite direction of the delta.
        N)r   r   )
ÚselfÚdeltaÚxÚyÚxxÚxyÚyxÚyyÚdxÚdys
             ú;/usr/lib/python3/dist-packages/ufoLib2/objects/component.pyÚmovezComponent.move'   sD   € ð ‰ˆˆ1Ø!%×!4Ñ!4ÑˆˆBB˜˜BÜ'¨¨B°°B¸¸Q¹ÀÀQÁÓGˆÕó    c                ó   — t        | |«      S )zØReturns the (xMin, yMin, xMax, yMax) bounding box of the component,
        taking the actual contours into account.

        Args:
            layer: The layer of the containing glyph to look up components.
        )r   ©r   Úlayers     r&   r   zComponent.getBounds6   s   € ô ˜˜uÓ%Ð%r(   c                ó   — t        | |«      S )zÜReturns the (xMin, yMin, xMax, yMax) bounding box of the component,
        taking only the control points into account.

        Args:
            layer: The layer of the containing glyph to look up components.
        )r   r*   s     r&   r   zComponent.getControlBounds?   s   € ô    eÓ,Ð,r(   c                ó<   — t        |«      }| j                  |«       y)zDraws component with given pen.N)r   Ú
drawPoints)r   ÚpenÚpointPens      r&   ÚdrawzComponent.drawL   s   € ä$ SÓ)ˆØ‰˜Õ!r(   c                ó  — 	 |j                  | j                  | j                  | j                  ¬«       y# t        $ rC |j                  | j                  | j                  «       t        j                  dt        «       Y yw xY w)z/Draws points of component with given point pen.)r   zgThe addComponent method needs an identifier kwarg. The component's identifier value has been discarded.N)ÚaddComponentr   r   r   Ú	TypeErrorÚwarningsÚwarnÚUserWarning)r   r0   s     r&   r.   zComponent.drawPointsQ   so   € ð
	Ø×!Ñ!Ø—‘ × 3Ñ 3ÀÇÁð "õ øô ò 	Ø×!Ñ! $§.¡.°$×2EÑ2EÔFÜM‰MðGäöð	ús   ‚25 µA	BÂ B)r   ztuple[float, float]ÚreturnÚNone)r+   r   r8   zBoundingBox | None)r/   r	   r8   r9   )r0   r
   r8   r9   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú__annotations__r   r   r   r   r   r'   r   r   r1   r.   © r(   r&   r   r      sM   … ñð ƒNØ<á %¨hÐBTÔ U€NIÓUØQà $€JÓ$Ø:óHó&ó-ó"ô
r(   r   )Ú
__future__r   r5   Útypingr   Úattrsr   r   ÚfontTools.misc.transformr   r   ÚfontTools.pens.basePenr	   ÚfontTools.pens.pointPenr
   r   ÚufoLib2.objects.miscr   ÚufoLib2.serder   ÚufoLib2.typingr   Úmiscr   r   r   r   r?   r(   r&   ú<module>rJ      sM   ðÝ "ã Ý ç ß 8Ý .ß Gå ,Ý Ý #ç AÑ Að Ø÷Ið Ió ó ñIr(   