Slide 88
Slide 88 text
sprinklePaint.color = it.color
canvas.drawRoundRect(
cx - 7f, cy - 22f,
cx + 7f, cy + 22f,
10f, 10f, sprinklePaint)
sprinklePaint.color = it.color
canvas.drawRoundRect(
cx - 7f, cy - 22f,
cx + 7f, cy + 22f,
10f, 10f, sprinklePaint)
// draw the sprinkles!
// draw the sprinkles!
Canvas Drawing
sprinkles.forEach {
sprinkles.forEach {
}
}
// draw the sprinkle
// draw the sprinkle
// restore the canvas
// restore the canvas
// calculate the position
// calculate the position
// move the canvas
// move the canvas
val modDistance = holeRadius + padding
+ (ringRadius - padding * 2)
* it.distance
canvas.save()
canvas.rotate(it.angle, cx, cy)
canvas.translate(0f, modDistance)
canvas.rotate(it.rotation, cx, cy)
canvas.save()
canvas.rotate(it.angle, cx, cy)
canvas.translate(0f, modDistance)
canvas.rotate(it.rotation, cx, cy)