/*
 * ********************************************************************************************************************
 *
 *               iFHS7.
 *              ;BBMBMBMc                  rZMBMBR              BMB
 *              MBEr:;PBM,               7MBMMEOBB:             BBB                       RBW
 *     XK:      BO     SB.     :SZ       MBM.       c;;     ir  BBM :FFr       :SSF:    ;xBMB:r   iuGXv.    i:. iF2;
 *     DBBM0r.  :D     S7   ;XMBMB       GMBMu.     MBM:   BMB  MBMBBBMBMS   WMBMBMBBK  MBMBMBM  BMBRBMBW  .MBMBMBMBB
 *      :JMRMMD  ..    ,  1MMRM1;         ;MBMBBR:   MBM  ;MB:  BMB:   MBM. RMBr   sBMH   BM0         UMB,  BMB.  KMBv
 *     ;.   XOW  B1; :uM: 1RE,   i           .2BMBs  rMB. MBO   MBO    JMB; MBB     MBM   BBS    7MBMBOBM:  MBW   :BMc
 *     OBRJ.SEE  MRDOWOR, 3DE:7OBM       .     ;BMB   RMR7BM    BMB    MBB. BMB    ,BMR  .BBZ   MMB   rMB,  BMM   rMB7
 *     :FBRO0D0  RKXSXPR. JOKOOMPi       BMBSSWBMB;    BMBB:    MBMB0ZMBMS  .BMBOXRBMB    MBMDE RBM2;SMBM;  MBB   xBM2
 *         iZGE  O0SHSPO. uGZ7.          sBMBMBDL      :BMO     OZu:BMBK,     rRBMB0;     ,EBMB  xBMBr:ER.  RDU   :OO;
 *     ,BZ, 1D0  RPSFHXR. xWZ .SMr                  . .BBB
 *      :0BMRDG  RESSSKR. 2WOMBW;                   BMBMR
 *         i0BM: SWKHKGO  MBDv
 *           .UB  OOGDM. MK,                                          Copyright (c) 2015-2019.  斯伯坦机器人
 *              ,  XMW  ..
 *                  r                                                                     All rights reserved.
 *
 * ********************************************************************************************************************
 */

package com.sybotan.android.base.extensions

import android.graphics.Path

/**
 * 为Path扩展logo接口
 *
 * @return  logo的Path路径
 */
fun Path.logo(zoom: Float = 1f): Path {

    val p1 = Path()
    p1.addCircle(0f * zoom, 20f * zoom, 30f * zoom, Path.Direction.CCW)
    val headPath = Path()
    headPath.addCircle(0f * zoom, 0f * zoom, 50f * zoom, Path.Direction.CCW)
    headPath.op(p1, Path.Op.DIFFERENCE)

    val bodyPath = Path()
    bodyPath.rLineTo(40f * zoom, -20f * zoom)
    bodyPath.rLineTo(0f * zoom, 110f * zoom)
    bodyPath.rLineTo(-10f * zoom, 30f * zoom)
    bodyPath.rLineTo(-30f * zoom, 40f * zoom)
    bodyPath.rLineTo(-30f * zoom, -40f * zoom)
    bodyPath.rLineTo(-10f * zoom, -30f * zoom)
    bodyPath.rLineTo(0f * zoom, -110f * zoom)
    bodyPath.close()

    val leftPath = Path()
    leftPath.rLineTo(0f * zoom, 120f * zoom)
    leftPath.rLineTo(20f * zoom, 50f * zoom)
    leftPath.rLineTo(-90f * zoom, -60f * zoom)
    leftPath.rLineTo(-10f * zoom, -30f * zoom)
    leftPath.rLineTo(50f * zoom, 25f * zoom)
    leftPath.rLineTo(0f * zoom, -20f * zoom)
    leftPath.rLineTo(-50f * zoom, -25f * zoom)
    leftPath.rLineTo(0f * zoom, -40f * zoom)
    leftPath.rLineTo(50f * zoom, 25f * zoom)
    leftPath.rLineTo(0f * zoom, -20f * zoom)
    leftPath.rLineTo(-50f * zoom, -25f * zoom)
    leftPath.rLineTo(0f * zoom, -40f * zoom)
    leftPath.close()

    val rightPath = Path()
    rightPath.rLineTo(0f * zoom, 120f * zoom)
    rightPath.rLineTo(-20f * zoom, 50f * zoom)
    rightPath.rLineTo(90f * zoom, -60f * zoom)
    rightPath.rLineTo(10f * zoom, -30f * zoom)
    rightPath.rLineTo(-50f * zoom, 25f * zoom)
    rightPath.rLineTo(0f * zoom, -20f * zoom)
    rightPath.rLineTo(50f * zoom, -25f * zoom)
    rightPath.rLineTo(0f * zoom, -40f * zoom)
    rightPath.rLineTo(-50f * zoom, 25f * zoom)
    rightPath.rLineTo(0f * zoom, -20f * zoom)
    rightPath.rLineTo(50f * zoom, -25f * zoom)
    rightPath.rLineTo(0f * zoom, -40f * zoom)
    rightPath.close()

    val logoPath = Path()
    logoPath.addPath(headPath, 0f * zoom, -90f * zoom)
    logoPath.addPath(bodyPath, 0f * zoom, -20f * zoom)
    logoPath.addPath(leftPath, -60f * zoom, -50f * zoom)
    logoPath.addPath(rightPath, 60f * zoom, -50f * zoom)
    return logoPath
} // Function logo()