Search in sources :

Example 1 with CGMutablePath

use of org.robovm.apple.coregraphics.CGMutablePath in project playn by threerings.

the class RoboCanvas method fillCircle.

@Override
public Canvas fillCircle(float x, float y, float radius) {
    RoboGradient gradient = currentState().gradient;
    if (gradient == null) {
        bctx.fillEllipseInRect(new CGRect(x - radius, y - radius, 2 * radius, 2 * radius));
    } else {
        CGMutablePath cgPath = CGMutablePath.createMutable();
        cgPath.addArc(null, x, y, radius, 0, 2 * Math.PI, false);
        bctx.addPath(cgPath);
        bctx.clip();
        gradient.fill(bctx);
    }
    isDirty = true;
    return this;
}
Also used : CGMutablePath(org.robovm.apple.coregraphics.CGMutablePath) CGRect(org.robovm.apple.coregraphics.CGRect)

Aggregations

CGMutablePath (org.robovm.apple.coregraphics.CGMutablePath)1 CGRect (org.robovm.apple.coregraphics.CGRect)1