
\c           @  s   d  d l  m Z d  d l Z d  d l m Z m Z m Z d  d l m	 Z	 d  d l
 m Z m Z m Z d  d l Z d   Z d   Z d   Z d	 e j j j e j j f d
     YZ d e j j j f d     YZ d   Z d S(   i(   t   print_functionN(   t   rendert   Rendert   redraw(   t   absolute(   t	   map_eventt   runt   run_unhoveredc          C  s@   t  j j   j }  |  j } | d k r< t   } | |  _ n  | S(   sK   
    Gets the default drag group. If it doesn't exist yet, creates it.
    N(   t   renpyt   gamet   contextt   scene_listst
   drag_groupt   Nonet	   DragGroup(   t   slst   rv(    (    so   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\dragdrop.pyt   default_drag_group#   s    		c         C  s   |  d d f g S(   Ni    (    (   t   drag(    (    so   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\dragdrop.pyt   default_drag_joined3   s    c         C  s   t  S(   N(   t   True(   t   dropt   drags(    (    so   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\dragdrop.pyt   default_drop_allowable7   s    t   Dragc           B  s  e  Z d  Z d Z e Z d Z d Z e	 Z
 d Z d Z d Z d d e e e d d e d e d d d d e	 e	 d d d d  Z d d  Z d   Z d   Z d	   Z d
   Z d   Z d   Z d   Z e	 d  Z e	 d  Z d   Z d   Z d   Z d   Z RS(   sC  
    :doc: drag_drop class
    :args: (d=None, drag_name=None, draggable=True, droppable=True, drag_raise=True, dragged=None, dropped=None, drag_handle=(0.0, 0.0, 1.0, 1.0), drag_joined=..., clicked=None, hovered=None, unhovered=None, mouse_drop=False, **properties)

    A displayable that represents an object that can be dragged around
    its enclosing area. A Drag can also represent an area that
    other Drags can be dropped on.

    A Drag can be moved around inside is parent. Generally, its parent
    should be either a :func:`Fixed` or :class:`DragGroup`.

    A Drag has one child. The child's state reflects the status
    of the drag and drop operation:

    * ``selected_hover`` - when it is being dragged.
    * ``selected_idle`` - when it can be dropped on.
    * ``hover`` - when the draggable will be dragged when the mouse is
      clicked.
    * ``idle`` - otherwise.

    The drag handle is a rectangle inside the child. The mouse must be over
    a non-transparent pixel inside the drag handle for dragging or clicking
    to occur.

    A newly-created draggable is added to the default DragGroup. A draggable
    can only be in a single DragGroup - if it's added to a second group,
    it's removed from the first.

    When a Drag is first rendered, if it's position cannot be determined
    from the DragGroup it is in, the position of its upper-left corner
    is computed using the standard layout algorithm. Once that position


    `d`
        If present, the child of this Drag. Drags use the child style
        in preference to this, if it's not None.

    `drag_name`
        If not None, the name of this draggable. This is available
        as the `name` property of draggable objects. If a Drag
        with the same name is or was in the DragGroup, the starting
        position of this Drag is taken from that Draggable.

    `draggable`
        If true, the Drag can be dragged around the screen with
        the mouse.

    `droppable`
        If true, other Drags can be dropped on this Drag.

    `drag_raise`
        If true, this Drag is raised to the top when it is dragged. If
        it is joined to other Drags, all joined drags are raised.

    `activated`
        A callback (or list of callbacks) that is called when the mouse
        is pressed down on the drag. It is called with one argument, a
        a list of Drags that are being dragged. The return value of this
        callback is ignored.

    `dragged`
        A callback (or list of callbacks) that is called when the Drag
        has been dragged. It is called with two arguments. The first is
        a list of Drags that are being dragged. The second is either
        a Drag that is being dropped onto, or None of a drop did not
        occur. If the callback returns a value other than None, that
        value is returned as the result of the interaction.

    `dropped`
        A callback (or list of callbacks) that is called when this Drag
        is dropped onto. It is called with two arguments. The first
        is the Drag being dropped onto. The second is a list of Drags that
        are being dragged.  If the callback returns a value other than None,
        that value is returned as the result of the interaction.

        When a dragged and dropped callback are triggered for the same
        event, the dropped callback is only called if dragged returns
        None.

    `clicked`
        A callback this is called, with no arguments, when the Drag is
        clicked without being moved. A droppable can also be focused
        and clicked.  If the callback returns a value other than None,
        that value is returned as the result of the interaction.

    `alternate`
        An action that is run when the Drag is right-clicked (on the
        desktop) or long-pressed without moving (on mobile). It may
        be necessary to increase :var:`config.longpress_duration` if
        this triggers to early on mobile platforms.

    `drag_handle`
        A (x, y, width, height) tuple, giving the position of the drag
        handle within the child. In this tuple, integers are considered
        to be a literal number of pixels, while floats are relative to
        the size of the child.

    `drag_joined`
        This is called with the current Drag as an argument. It's
        expected to return a list of [ (drag, x, y) ] tuples, giving
        the draggables to drag as a unit. `x` and `y` are the offsets
        of the drags relative to each other, they are not relative
        to the corner of this drag.

    `drag_offscreen`
        If true, this draggable can be moved offscreen. This can be
        dangerous to use with drag_joined or drags that can change
        size, as the drags can leave the screen entirely, with no
        way to get them back on the screen.

    `mouse_drop`
        If true, the drag is dropped on the first droppable under the cursor.
        If false, the default, the drag is dropped onto the droppable with
        the largest degree of overlap.

    `drop_allowable`
        A callback that is called to determine whether this drop allow
        the current drags dropped onto. It is called with two arguments.
        The first is the Drag which determines its sensitivity.
        The second is a list of Drags that are being dragged.

    Except for `d`, all of the parameters are available as fields (with
    the same name) on the Drag object. In addition, after the drag has
    been rendered, the following fields become available:

    `x`, `y`
         The position of the Drag relative to its parent, in pixels.

    `w`, `h`
         The width and height of the Drag's child, in pixels.
    i    g        g      ?R   c         K  s  t  t |   j d | |  | |  _ | |  _ | |  _ | |  _ | |  _ | |  _ | |  _	 |	 |  _
 |
 |  _ | |  _ | |  _ | |  _ | |  _ | |  _ | |  _ | |  _ | |  _ d  |  _ | r t   |  _ n  d  |  _ d  |  _ d  |  _ d  |  _ d  |  _ d  |  _ d  |  _ d  |  _ d  |  _  d  |  _! d  |  _" d  |  _# d  |  _$ d |  _% d |  _& d |  _' d |  _( d |  _) d  |  _* t+ |  _, d |  _- | d  k	 rk| j |  _ | j |  _ | j' |  _' | j |  _ | j  |  _  | j( |  _( | j) |  _) | j! |  _! | j" |  _" | j# |  _# | j$ |  _$ | j |  _ | j, |  _, | j* |  _* | j |  _ | j. |  _. | j- |  _- n  | d  k	 r|  j/ |  n  d  S(   Nt   stylei    (0   t   superR   t   __init__t	   drag_namet	   draggablet	   droppablet
   drag_raiset   draggedt   droppedt   drop_allowablet   drag_handlet   drag_joinedt   clickedt   hoveredt	   unhoveredt	   activatedt	   alternatet   drag_offscreent
   mouse_dropt	   focusableR   t   childR   R   t   xt   yt   wt   ht   old_positiont   parent_widtht   parent_heightt   target_xt   target_yt   grab_xt   grab_yt   last_xt   last_yt   start_xt   start_yt   att	   target_att   target_at_delayt	   last_dropt   Falset
   drag_movedt   zt
   click_timet   add(   t   selft   dR   R   R   R   R    R!   R"   R#   R$   R%   R&   R'   t   replacesR*   R+   R(   R)   R   t
   properties(    (    so   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\dragdrop.pyR      s|    																																							c         C  s   t  |  t k r( t | |  j  } n  t  |  t k rP t | |  j  } n  | |  _ | |  _ |  j d k	 r} | |  _	 n |  j
 |  _ | |  _ | |  _ |  j d k	 r | | |  j f |  j j |  j <n  t |  d  d S(   s
  
        :doc: drag_drop method

        Changes the position of the drag. If the drag is not showing,
        then the position change is instantaneous. Otherwise, the
        position change takes `delay` seconds, and is animated as a
        linear move.
        i    N(   t   typet   floatt   intR3   R4   R5   R6   R.   R   R?   R=   R>   R/   R   R2   t	   positionsR   R   (   RF   R.   R/   t   delay(    (    so   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\dragdrop.pyt   snapL  s    
				"c         C  sK   | rG t  t |   j | |  |  j d  k	 rG |  j j | t  qG n  d  S(   N(   R   R   t   set_style_prefixR-   R   RA   (   RF   t   prefixt   root(    (    so   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\dragdrop.pyRP   k  s    c         C  s7   |  j  d  k	 r t d   n  t j j |  |  _  d  S(   Ns)   Drag expects either zero or one children.(   R-   R   t	   ExceptionR   t   easyt   displayable(   RF   RG   (    (    so   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\dragdrop.pyRE   r  s    c         C  s#   d  |  _ t j j j |  d  d  S(   Ni    (   R   R-   R   t   displayR   R   (   RF   (    (    so   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\dragdrop.pyt   _clearx  s    	c         C  s6   | j    t j j |  |  _ t j j j |   d S(   sX   
        :doc: drag_drop method

        Changes the child of this drag to `d`.
        N(   t   per_interactR   RT   RU   R-   RV   R   t
   invalidate(   RF   RG   (    (    so   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\dragdrop.pyt	   set_child|  s    
c         C  s)   |  j  d k	 r% |  j  j |  g  n  d S(   sg   
        :doc: drag_drop method

        Raises this displayable to the top of its drag_group.
        N(   R   R   t   raise_children(   RF   (    (    so   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\dragdrop.pyt   top  s    c         C  s)   |  j  d k	 r% |  j  j |  g  n  d S(   sj   
        :doc: drag_drop method

        Lowers this displayable to the bottom of its drag_group.
        N(   R   R   t   lower_children(   RF   (    (    so   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\dragdrop.pyt   bottom  s    c         C  s
   |  j  g S(   N(   R-   (   RF   (    (    so   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\dragdrop.pyt   visit  s    c         C  s8   t  t |   j |  d  } | s4 t |  j  } n  | S(   N(   R   R   t   focusR   R   R&   (   RF   t   defaultR   (    (    so   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\dragdrop.pyR`     s
    c         C  s=   t  t |   j |  | s9 t |  j  t |  j  n  d  S(   N(   R   R   t   unfocusR   R&   R   R'   (   RF   Ra   (    (    so   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\dragdrop.pyRb     s    c      
   C  s  |  j  j } | d  k r$ |  j } n  t j j j |  _ t j j j |  _	 t | | | | |  } | j
   \ } } t | |  }	 |	 j | d  | |  _ | |  _ |  j  j |  j  j |  j  j |  j  j |  j  j |  j  j f }
 |  j d  k r|  j d  k	 r|  j d  k	 r|  j |  j j k r|  j j |  j } t |  d k ra| \ |  _ |  _ |  _ q| \ |  _ |  _ |
 |  _ qn  |  j |
 k rt } n |  j d  k rt } n t } | rd  |  _ |  j d  d d | | |	  \ } } t |  |  _ t |  |  _ d  |  _  |
 |  _ n  |  j  d  k rQ|  j |  _  |  j |  _! | |  _" n  |  j# r| |  j# |  _" d |  _# t$ |  d  n | |  j" k r|  j  |  _ |  j! |  _ np | |  j% |  j" |  j% } t& |  j | |  j  |  j  |  _ t& |  j | |  j! |  j  |  _ t$ |  d  |  j' s5|  j( d  k	 r|  j) \ } } } } t* | t+  rlt | |  } n  t* | t+  rt | |  } n  t* | t+  rt | |  } n  t* | t+  rt | |  } n  |  j  j, } | t k r| j- | | | | f  } n_ | d  k	 rgy% t j j j | | | | |  } Wqgt. |  rT| } qdt/ d   qgXn  | d  k	 rd } d } n d  } d  } |	 j0 |  d  | | | | | | | 	 n  |  j |  _1 |  j |  _2 | |  _% |	 S(   Ni    i   s<   Focus_mask must be None, True, a displayable, or a callable.(   i    i    (3   R   R-   R   R   RV   R   t   render_widthR3   t   render_heightR4   t   get_sizeR   t   blitR0   R1   t   xpost   ypost   xanchort   yanchort   xoffsett   yoffsetR.   R   R   RM   t   lenR/   R2   R   RA   t   placeRL   R5   R6   R>   R?   R   R=   R   R   R%   R#   t
   isinstanceRK   t
   focus_maskt
   subsurfacet   callableRS   t	   add_focusR9   R:   (   RF   t   widtht   heightt   stR=   R-   t   crt   cwt   chR   t   positiont   dgpRn   t   place_xt   place_yt   donet   fxt   fyt   fwt   fht   maskt   fmxt   fmy(    (    so   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\dragdrop.pyR     s    		<-			$			$$%		(	c         C  sP  |  j    s% |  j j | | | |  St |  j |  } t |  j |  } t j j j	   |  k } |  j
 d  k	 r t j j r t | d  r | |  _ t j j j t j j  n  | r |  j |   } g  | D] }	 |	 d ^ q }
 nV|  j rt | d  r|  j |   } g  | D] }	 |	 d ^ q}
 |
 sFt j j j    n  t j j j |   t |
 d j |
  | |  _ | |  _ xE | D]= \ }	 } } |	 |  k r|  j | 7_ |  j | 7_ PqqWt |  _ | |  _ | |  _  t! } nR |  j
 d  k	 r=t | d  r=t |  j
  } | d  k	 r(| St j j j    n  |  j
 d  k	 rt j j r|  j d  k	 r| |  j t j j k rd  |  _ t |  j
  } | d  k	 r| Sn  | s%|  j" d  k	 rt | d  rd  |  _ t |  j"  } | d  k	 r| St j j j    n  |  j j | | | |  S| j# t$ j% t$ j& t$ j' f k r!t! } |  j r|  j | k st|  j  | k rt! |  _ d  |  _ |  j( d t!  x |
 D] }	 |	 j( d t!  qW|  j) r|  j* d  k	 r|  j* j+ |
  qn  |  j r'x-| D]"\ }	 } } t | |  j |  } t | |  j |  } |  j, st- | d  } t. | t |	 j/ |	 j0   } t- | d  } t. | t |	 j1 |	 j2   } n  |	 j* d  k	 r|	 j3 d  k	 r| | |  j4 f |	 j* j5 |	 j3 <n  | |	 _6 | |	 _7 | |	 _8 | |	 _9 |  j: |	 _; t< |	 d  qWq'n t } |  j* d  k	 rx|  j rx|  j= rc|  j* j> |
 | |  } q~|  j* j? |
  } n d  } | |  j@ k	 r|  j@ d  k	 r|  j@ j( d t!  n  | d  k	 r| j( d t!  n  | |  _@ n  t | d  r1d  |  _ t j j j d   | d  k	 r'| j( d t!  n  x |
 D] }	 |	 j( d t!  q.W|  j( d t!  d  |  _ d  |  _ d  |  _@ |  j r|
 d } | jA d  k	 rt | jA |
 |  } | d  k	 r| Sn  | d  k	 r.| jB d  k	 r.t | jB | |
  } | d  k	 r | Sq.q1|  j" r1t |  j"  } | d  k	 r.| Sq1n  | rLt j j j    n  d  S(	   Nt   drag_activatei    t   button_alternatet   drag_deactivatet   idle_t   selected_hover_t   selected_idle_t   hover_(C   t
   is_focusedR-   t   eventRL   R9   R:   R   RV   R`   t   get_grabR)   R   t   touchR   RD   R	   t	   interfacet   timeoutt   configt   longpress_durationR$   R   t   coret   IgnoreEventt   set_grabR   R(   R7   R8   RA   RB   R;   R<   R   R%   RJ   t   pygamet   MOUSEMOTIONt   MOUSEBUTTONUPt   MOUSEBUTTONDOWNRP   R   R   R[   R*   t   maxt   minR3   R0   R4   R1   R   R2   RM   R.   R/   R5   R6   R=   R>   R   R+   t   get_drop_att   get_best_dropR@   R    R!   (   RF   t   evR.   R/   Rv   t   par_xt   par_yt   grabbedt   joined_offsetst   it   joinedt   xot   yoR   t   handledt   new_xt   new_yR   R   (    (    so   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\dragdrop.pyR   %  s    *	 								!(				""										

	
c         C  sE   |  j  d  k	 r. |  j  |  j d d d d t f St t |   j   Sd  S(   Ni    (   R.   R   R/   R   R   R   t   get_placement(   RF   (    (    so   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\dragdrop.pyR     s    c         C  s'   |  j  d t  t t |   j   d  S(   NR   (   RP   R   R   R   RX   (   RF   (    (    so   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\dragdrop.pyRX     s    N(   g        g        g      ?g      ?(   t   __name__t
   __module__t   __doc__RC   R   R,   R   R   R2   RA   R*   R(   R)   RD   R   R   R   RO   RP   RE   RW   RZ   R\   R^   R_   R`   Rb   R   R   R   RX   (    (    (    so   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\dragdrop.pyR   ;   sT   l					
	
	
	v		R   c           B  s   e  Z d  Z d Z e Z e j j Z	 d   Z
 d   Z d   Z d   Z d   Z d   Z d   Z d	   Z d
   Z d   Z d   Z d   Z RS(   s&  
    :doc: drag_drop class

    Represents a group of Drags. A Drag is limited to the boundary of
    its DragGroup. Dropping only works between Drags that are in the
    same DragGroup. Drags may only be raised when they are inside a
    DragGroup.

    A DragGroup is laid out like a :func:`Fixed`.

    All positional parameters to the DragGroup constructor should be
    Drags, that are added to the DragGroup.


    `min_overlap`
        An integer which means the minimum number of pixels at the
        overlap so that drop will be allow.
    i    c         C  s   d S(   NR   (    (   RF   (    (    so   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\dragdrop.pyt   __unicode__  s    c         O  s   | j  d d  | j  d d  | j d d   } | j d d  } | |  _ t t |   j |   t |  _ | d  k	 r t	 j
 j | j  |  _ | j |  _ | j |  _ n$ t	 j
 j   |  _ t |  _ d |  _ x | D] } |  j |  q Wd  S(   NR   t   fixedt   layoutRH   t   min_overlapi    (   t
   setdefaultt   popR   R   R   R   R   RA   t   sortedR   t   pythont   RevertableDictRM   t	   sensitivet   z_serialR   RE   (   RF   t   childrenRI   RH   R   R   (    (    so   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\dragdrop.pyR     s     				c         C  sJ   t  | t  s t d   n  |  | _ t t |   j |  t |  _ d S(   sh   
        :doc: drag_drop method

        Adds `child`, which must be a Drag, to this DragGroup.
        s(   Only drags can be added to a drag group.N(	   Ro   R   RS   R   R   R   RE   RA   R   (   RF   R-   (    (    so   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\dragdrop.pyRE   !  s
    	c         C  sA   t  | t  s t d   n  d | _ t t |   j |  d S(   sV   
        :doc: drag_drop method

        Removes `child` from this DragGroup.
        s,   Only drags can be removed from a drag group.N(   Ro   R   RS   R   R.   R   R   t   remove(   RF   R-   (    (    so   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\dragdrop.pyR   0  s    	c         C  sJ   |  j  s+ |  j j d d    t |  _  n  t t |   j | | | |  S(   Nt   keyc         S  s   |  j  S(   N(   RC   (   R   (    (    so   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\dragdrop.pyt   <lambda>@  s    (   R   R   t   sortR   R   R   R   (   RF   Rt   Ru   Rv   R=   (    (    so   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\dragdrop.pyR   =  s    	c         C  s,   |  j  s d  St t |   j | | | |  S(   N(   R   R   R   R   R   (   RF   R   R.   R/   Rv   (    (    so   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\dragdrop.pyR   E  s    	c         C  sO   t  |  _ x) | D]! } |  j d 7_ |  j | _ q Wt j j j |  d  d S(   s   
        Raises the children in `l` to the top of this drag_group, using the
        order given in l for those children.
        i   i    N(   RA   R   R   RC   R   RV   R   R   (   RF   t   lR   (    (    so   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\dragdrop.pyR[   L  s
    	c         C  sP   t  |  _ x* | D]" } |  j d 7_ |  j | _ q Wt j j j |  d  d S(   s   
        Lowers the children in `l` to the bottom of this drag group, with
        the one at the bottom being the lowest.
        i   i    N(   RA   R   R   RC   R   RV   R   R   (   RF   R   R   (    (    so   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\dragdrop.pyR]   Z  s
    	c   
      C  s  d } d } t  |  } x | D] } | j | j | j | j f } x |  j D] } | | k re qM n  | j st qM n  | j d k r qM n  | j | j | j | j f } t | |  }	 |	 | k rM |	 |  j	 k rM | j
 | |  rM | } |	 } qM qM Wq W| d k r
d S| Sd S(   sT   
        Returns the droppable that the members of joined overlap the most.
        i    N(   t   setR.   R/   R0   R1   R   R   R   t   rect_overlap_areaR   R"   (
   RF   R   t   max_overlapR   t
   joined_setRG   t   r1t   ct   r2t   overlap(    (    so   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\dragdrop.pyR   h  s,    	c         C  s   t  |  } x |  j D] } | | k r. q n  | j s= q n  | j d k rR q n  | | j k r | | j k r | | j | j k  r | | j | j k  r | j | |  r | Sq Wd S(   s@   
        Returns the droppable that is exactly at x, y.
        N(	   R   R   R   R.   R   R/   R0   R1   R"   (   RF   R   R.   R/   R   R   (    (    so   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\dragdrop.pyR     s    	,c         C  s   t  j j |  j  S(   sZ   
        Returns a list of Drags that are the children of
        this DragGroup.
        (   R   R   t   RevertableListR   (   RF   (    (    so   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\dragdrop.pyt   get_children  s    c         C  s+   x$ |  j  D] } | j | k r
 | Sq
 Wd S(   s   
        :doc: drag_drop method

        Returns the first child of this DragGroup that has a drag_name
        of name.
        N(   R   R   R   (   RF   t   nameR   (    (    so   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\dragdrop.pyt   get_child_by_name  s    (   R   R   R   R   RA   R   R   R   R   t
   _list_typeR   R   RE   R   R   R   R[   R]   R   R   R   R   (    (    (    so   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\dragdrop.pyR     s    									)		c         C  s   |  \ } } } } | \ } } } }	 t  | |  }
 t | | | |  } t  | |  } t | | | |	  } | |
 k  r d S| | k  r d S| |
 | | S(   sM   
    Returns the number of pixels by which rectangles r1 and r2 overlap.
    i    (   R   R   (   R   R   t   x1t   y1t   w1t   h1t   x2t   y2t   w2t   h2t   maxleftt   minrightt   maxtopt	   minbottom(    (    so   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\dragdrop.pyR     s    (   t
   __future__R    t   renpy.displayR   t   renpy.display.renderR   R   R   t   renpy.display.coreR   t   renpy.display.behaviorR   R   R   t   pygame_sdl2R   R   R   R   RV   R   t   DisplayableR   t   RevertableObjectR   R   t   MultiBoxR   R   (    (    (    so   C:\Users\romet\Desktop\TwistedScarlett Patreon Pack #13\FriendshipwithBenefits-0.1-pc\renpy\display\dragdrop.pyt   <module>   s   			(  