
    cc                     .    d dl Z ddlmZ  G d de      Zy)    N   )AbstractBrushc                   4     e Zd Zd Zd Z fdZd Zd Z xZS )BrushNibc                 &   t        d      dz   }|r|t        d      z  }n|t        d      z  }t        d      dz   }|dk(  r|t        d      z  }||gS |dk(  r|t        d      z  }||gS |d	k(  r|t        d
      z  }||gS |t        d      z  }||gS )NzCalligraphic nibz - z$Width depends on the stylus pressurez%Width depends on the line orientationrightzRight-handed nibverticalzVertical nibleftzLeft-handed nibzHorizontal nib)_)selfuse_pressurebrush_directionlabel_widthlabel_directions        3/usr/lib/python3/dist-packages/drawing/brush_nib.py	_get_tipszBrushNib._get_tips	   s    $%-+!:;;;!;<<;()E1/a*++? 	'' *$a''? 	'' & a)**? 	'' a())?
	''    c                     |j                  t        j                  j                         |j	                  t        j
                  j                          |j                  |d     t        | %  ||       y )Nrgba)
set_line_capcairoLineCapBUTTset_line_joinLineJoinROUNDset_source_rgbasuperdraw_preview)r   	operationcairo_context	__class__s      r   r   zBrushNib.draw_preview   sW    U]]//0enn223-6!23'y-0r   c                 V    |d   r| j                  ||      S | j                  ||       y)zStraight-shaped brush, like an orientable feather pen. The width is
		pressure-sensitive but otherwise it's NOT speed sensitive.
is_previewN)r   operation_on_mask)r   r!   r    s      r   do_brush_operationzBrushNib.do_brush_operation$   s/     |


I}
55M2r   c                    |d   dz  }g }|d   dk(  rddd}n!|d   dk(  rddd}n|d   d	k(  rddd}ndd
d}|d   |z  }|d   |z  }|d   d   d   d u}|s|}	|}
|}|}d }|d   D ]  }||r ||d   z  }	||d   z  }
||d   z  }||d   z  }|j                          |d   z   }|d   z   }|j                  ||       |d   |d
z  z   }|d   |d
z  z   }|j                  ||       |d   	d
z  z   }|d   
d
z  z   }|j                  ||       |d   |	z   }|d   |
z   }|j                  ||       |j                          |} y )N
line_width   nib_dirr
   r   )xy
horizontalr   r	   r+   r,   pathp)new_pathmove_toline_tofill)r   r!   r    r(   two_ways_pathfeather_defdx_basedy_baser   dx1dy1dx2dy2former_pointcurrent_pointr+   r,   s                    r   do_masked_brush_opzBrushNib.do_masked_brush_op-   s   
 &**-yV#q!;|+q!;z)q!;r";z)'z)'6"1%c*$6,		3	3	3	3, (  m\#&&S\#&&S]3''S]3''ScS AcS A!QcS2X%AcS2X%A!QSC"H$ASC"H$A!QSCASCA!Q<- r   )	__name__
__module____qualname____gtype_name__r   r   r&   r?   __classcell__)r"   s   @r   r   r      s    (&131 r   r   )r   abstract_brushr   r    r   r   <module>rG      s     )X } X r   