Example usage for android.graphics Canvas getClipBounds

List of usage examples for android.graphics Canvas getClipBounds

Introduction

In this page you can find the example usage for android.graphics Canvas getClipBounds.

Prototype

public final @NonNull Rect getClipBounds() 

Source Link

Document

Retrieve the bounds of the current clip (in local coordinates).

Usage

From source file:org.stockchart.series.LinearSeries.java

@Override
protected void postDraw(Canvas c) {
    if (fPoints.size() == 0)
        return;//from www .  j  a v  a  2  s  . com

    int h = c.getClipBounds().bottom;

    PointF firstPoint = fPoints.get(0);
    PointF lastPoint = fPoints.get(fPoints.size() - 1);

    fFillPath.lineTo(lastPoint.x, h);
    fFillPath.lineTo(firstPoint.x, h);
    fFillPath.close();

    this.fTempRectF.set(firstPoint.x, minY, lastPoint.x, h);
    this.getAppearance().applyFill(fPaint, fTempRectF);
    c.drawPath(fFillPath, fPaint);

    this.getAppearance().applyOutline(fPaint);
    c.drawPath(fLinePath, fPaint);

    if (fPointsVisible) {
        for (PointF p : fPoints) {
            float r = fDistanceBetweenPoints * fPointSizeInPercents * 0.5f;
            drawPoint(c, p.x, p.y, r);
        }
        //drawPoint(c, prevX,prevY,r);
    }
}

From source file:org.stockchart.core.Area.java

private void drawClear(Canvas c) {
    PaintUtils.drawFullRect(c, this.Paint(), fAreaAppearance, c.getClipBounds());
}