OwlCyberSecurity - MANAGER
Edit File: text.cpython-38.pyc
U ��]s< � @ s� d Z ddlZddlZddlZddlZddlZddlmZm Z m Z mZ ddlmZ ddl mZ ddlmZ ddlmZmZmZ dd lmZ dd lmZmZmZmZmZmZ e�e�Z ej!dd� �Z"d d� Z#dd� Z$e �%dgdgdgdgdgdgdgdgdgdgdgdgd��G dd� de��Z&e j'j(e�)e&�d � e �*e&j+� e j,d!d"d#�G d$d%� d%e&��Z-e j'j(e�)e-�d&� G d'd(� d(e.�Z/G d)d*� d*e.�Z0G d+d"� d"e&e0�Z1e j'j(e1j+j d,� dS )-z) Classes for including text in a figure. � N� )�artist�cbook� docstring�rcParams)�Artist)�FontProperties)�Line2D)�FancyArrowPatch�FancyBboxPatch� Rectangle)�TextPath)�Affine2D�Bbox�BboxBase�BboxTransformTo�IdentityTransform� Transformc c sB | � � r8| �� }z| �| �� � | V W 5 | �|� X n| V dS )zLTemporarily inserts newlines to the text if the wrap option is enabled. N)�get_wrap�get_text�set_text�_get_wrapped_text)�textobjZold_text� r �1/usr/lib/python3/dist-packages/matplotlib/text.py� _wrap_text s r c C sf zt | �d W S ttfk r` t�| d�s6| dkr<Y dS t�| d�rNY dS td�| ���Y nX dS )z� Return the text angle as float between 0 and 360 degrees. *rotation* may be 'horizontal', 'vertical', or a numeric value in degrees. �h Z horizontalN� Zverticalg �V@zRrotation is {!r}; expected either 'horizontal', 'vertical', numeric value, or None)�float� ValueError� TypeErrorr Z _str_equal�format)�rotationr r r �get_rotation) s �r# c C s� g }g }t �| �� �}t� �| �}| �|�\}}}|D ]\\} } }}| \} }|�||f�\}}||8 }|| || }}|�||g� |�||g� q8t|�t|� }}t |�| t |�| }}t� �|��||f�\}}||||fS )z� Calculate the bounding box of the text. Unlike :meth:`matplotlib.text.Text.get_extents` method, The bbox size of the text before the rotation is calculated. ) �np�deg2radr# r �rotate�_get_layout�transform_point�extend�min�max)�text�rendererZprojected_xsZprojected_ys�theta�tr�_�parts�d�t�wh�x�y�w�hZxt1Zyt1Zxt2Zyt2Zxt_boxZyt_box�w_box�h_box�x_box�y_boxr r r �_get_textbox<