canvas.drawCircle( bounds.exactCenterX(), // center x bounds.exactCenterY(), // center y bounds.width() / 2f, // radius basePaint) private val basePaint = Paint().apply { color = 0xFFc6853b.toInt() }\ canvas.drawCircle( bounds.exactCenterX(), // center x bounds.exactCenterY(), // center y bounds.width() / 2f, // radius basePaint) Canvas Drawing
canvas.drawCircle( bounds.exactCenterX(), // center x bounds.exactCenterY(), // center y bounds.width() / 2f, // radius basePaint) private val basePaint = Paint().apply { color = 0xFFc6853b.toInt() }\ canvas.drawCircle( bounds.exactCenterX(), // center x bounds.exactCenterY(), // center y bounds.width() / 2f, // radius basePaint) Canvas Drawing
canvas.drawCircle( bounds.exactCenterX(), // center x bounds.exactCenterY(), // center y bounds.width() / 2f, // radius basePaint) private val basePaint = Paint().apply { color = 0xFFc6853b.toInt() }\ canvas.drawCircle( bounds.exactCenterX(), // center x bounds.exactCenterY(), // center y bounds.width() / 2f, // radius basePaint) Canvas Drawing
canvas.drawCircle( bounds.exactCenterX(), // center x bounds.exactCenterY(), // center y bounds.width() / 2f, // radius basePaint) private val basePaint = Paint().apply { color = 0xFFc6853b.toInt() }\ canvas.drawCircle( bounds.exactCenterX(), // center x bounds.exactCenterY(), // center y bounds.width() / 2f, // radius basePaint) Canvas Drawing what
canvas.drawCircle( bounds.exactCenterX(), // center x bounds.exactCenterY(), // center y bounds.width() / 2f, // radius basePaint) private val basePaint = Paint().apply { color = 0xFFc6853b.toInt() }\ canvas.drawCircle( bounds.exactCenterX(), // center x bounds.exactCenterY(), // center y bounds.width() / 2f, // radius basePaint) Canvas Drawing what how
canvas.drawCircle( bounds.exactCenterX(), // center x bounds.exactCenterY(), // center y bounds.width() / 2f, // radius basePaint) private val basePaint = Paint().apply { color = 0xFFc6853b.toInt() }\ canvas.drawCircle( bounds.exactCenterX(), // center x bounds.exactCenterY(), // center y bounds.width() / 2f, // radius basePaint) Canvas Drawing
canvas.drawCircle( bounds.exactCenterX(), // center x bounds.exactCenterY(), // center y bounds.width() / 2f, // radius basePaint) private val basePaint = Paint().apply { color = 0xFFc6853b.toInt() }\ canvas.drawCircle( bounds.exactCenterX(), // center x bounds.exactCenterY(), // center y bounds.width() / 2f, // radius basePaint) Canvas Drawing
canvas.drawCircle( bounds.exactCenterX(), // center x bounds.exactCenterY(), // center y bounds.width() / 2f, // radius basePaint) private val basePaint = Paint().apply { color = 0xFFc6853b.toInt() }\ canvas.drawCircle( bounds.exactCenterX(), // center x bounds.exactCenterY(), // center y bounds.width() / 2f, // radius basePaint) Canvas Drawing
canvas.drawCircle( bounds.exactCenterX(), // center x bounds.exactCenterY(), // center y bounds.width() / 2f, // radius basePaint) Canvas Drawing private val basePaint = Paint().also { it.color = 0xFFc6853b.toInt() }\ canvas.drawCircle( bounds.exactCenterX(), // center x bounds.exactCenterY(), // center y bounds.width() / 2f, // radius basePaint) // draw the base
the hole // Clip the hole // draw the base Canvas Drawing // draw the base DiscretePathEffect(60f, 25f) DiscretePathEffect(60f, 25f) CornerPathEffect(40f) CornerPathEffect(40f)
the hole // Clip the hole // draw the base Canvas Drawing // draw the base DiscretePathEffect(60f, 25f) DiscretePathEffect(60f, 25f) CornerPathEffect(40f) CornerPathEffect(40f)
clip the hole // Clip the hole // draw the base Canvas Drawing // draw the base DiscretePathEffect(60f, 25f) DiscretePathEffect(60f, 25f) CornerPathEffect(40f) CornerPathEffect(40f) ComposePathEffect( ComposePathEffect( ) ) ,
clip the hole // Clip the hole // draw the base Canvas Drawing // draw the base DiscretePathEffect(60f, 25f) DiscretePathEffect(60f, 25f) CornerPathEffect(40f) CornerPathEffect(40f) ComposePathEffect( ComposePathEffect( ) ) ,
the hole // Clip the hole // draw the base Canvas Drawing // draw the base ComposePathEffect( ComposePathEffect() ) canvas.drawCircle( bounds.exactCenterX(), bounds.exactCenterY(), bounds.width() / 2.1f, icingPaint)
the hole // Clip the hole // draw the base Canvas Drawing // draw the base ComposePathEffect( ComposePathEffect() ) canvas.drawCircle( bounds.exactCenterX(), bounds.exactCenterY(), bounds.width() / 2.1f, icingPaint)
sprinkles.forEach { sprinkles.forEach { // move the canvas // move the canvas // draw the sprinkle // draw the sprinkle // calculate the position // calculate the position } }
sprinkles.forEach { sprinkles.forEach { // move the canvas // move the canvas // draw the sprinkle // draw the sprinkle // restore the canvas // restore the canvas // calculate the position // calculate the position } }
sprinkles.forEach { sprinkles.forEach { // move the canvas // move the canvas // draw the sprinkle // draw the sprinkle // restore the canvas // restore the canvas val modDistance = holeRadius + padding + (ringRadius - padding * 2) * it.distance // calculate the position // calculate the position } }
// draw the icing // clip the hole // Clip the hole // draw the base // draw the base // draw the sprinkles! canvas.scale(0.5f, 0.5f, bounds.width() / 2f, bounds.height() / 2f)
// draw the icing // clip the hole // Clip the hole // draw the base // draw the base // draw the sprinkles! canvas.scale(0.5f, 0.5f, bounds.width() / 2f, bounds.height() / 2f) canvas.restore() canvas.save()
// draw the icing // clip the hole // Clip the hole // draw the base // draw the base // draw the sprinkles! canvas.restore() canvas.save() canvas.scale(0.5f, 0.5f, bounds.width() / 2f, bounds.height() / 2f)
bounds.width() / 2f, bounds.height() / 2f) // draw the sprinkles! Canvas Drawing // draw the icing // draw the icing // clip the hole // Clip the hole // draw the base // draw the base // draw the sprinkles! canvas.restore() canvas.save()
bounds.width() / 2f, bounds.height() / 2f) // draw the sprinkles! Canvas Drawing // draw the icing // draw the icing // clip the hole // Clip the hole // draw the base // draw the base // draw the sprinkles! canvas.restore() canvas.save()
bounds.width() / 2f, bounds.height() / 2f) // draw the sprinkles! Canvas Drawing // draw the icing // draw the icing // clip the hole // Clip the hole // draw the base // draw the base // draw the sprinkles! canvas.restore() canvas.save()