package zhy.com.highlight.shape;

import android.graphics.Bitmap;
import android.graphics.BlurMaskFilter;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.RectF;

import zhy.com.highlight.HighLight;

/**
 * Created by caizepeng on 16/8/20.
 * Edited by isanwenyu@163.com 16/10/26.
 */
public class RectLightShape extends BaseLightShape {
    public RectLightShape() {
        super();
    }

    public RectLightShape(float dx, float dy, float blurRadius) {
        super(dx, dy, blurRadius);
    }

    public RectLightShape(float dx, float dy) {
        super(dx, dy);
    }

    @Override
    protected void drawShape(Bitmap bitmap, HighLight.ViewPosInfo viewPosInfo) {
        Canvas canvas = new Canvas(bitmap);
        Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG);
        paint.setDither(true);
        paint.setAntiAlias(true);
        if (blurRadius > 0) {
            paint.setMaskFilter(new BlurMaskFilter(blurRadius, BlurMaskFilter.Blur.SOLID));
        }
        canvas.drawRoundRect(viewPosInfo.rectF,6,6,paint);
    }

    @Override
    protected void resetRectF4Shape(RectF viewPosInfoRectF, float dx, float dy) {
        viewPosInfoRectF.inset(dx,dy);
    }
}

@@ -373,53 +373,642 @@
 e %7B%0A
-    public RectLightShape() %7B%0A        super()
+%0A    private float rx=6; //The x-radius of the oval used to round the corners%0A    private float ry=6; //The y-radius of the oval used to round the corners%0A    public RectLightShape() %7B%0A        super();%0A    %7D%0A%0A    /**%0A     * @param dx %E6%B0%B4%E5%B9%B3%E6%96%B9%E5%90%91%E5%81%8F%E7%A7%BB%0A     * @param dy %E5%9E%82%E7%9B%B4%E6%96%B9%E5%90%91%E5%81%8F%E7%A7%BB%0A     * @param blurRadius %E6%A8%A1%E7%B3%8A%E5%8D%8A%E5%BE%84 %E9%BB%98%E8%AE%A415px 0%E4%B8%8D%E6%A8%A1%E7%B3%8A%0A     * @param rx The x-radius of the oval used to round the corners,default 6px.%0A     * @param ry The y-radius of the oval used to round the corners,default 6px.%0A     */%0A    public RectLightShape(float dx, float dy, float blurRadius,float rx,float ry) %7B%0A        super(dx, dy, blurRadius);%0A        this.rx=rx;%0A        this.ry=ry
 ;%0A  
@@ -1641,11 +1641,13 @@
 ctF,
-6,6
+rx,ry
 ,pai

add the attribute of x-radius and y-radius that the oval used to round the corners for RectLightShape