import { ensureRendererRegistry } from '../global' const registry = ensureRendererRegistry() registry.flake = function(context: CanvasRenderingContext2D, x: number, y: number, r: number){ const branchSize = r * 3 context.save() context.translate(x, y) context.fillStyle = 'rgba(255,255,255,0.9)' context.strokeStyle = 'rgba(255,255,255,0.9)' context.lineWidth = branchSize * 0.15 for (let i = 0; i < 6; i++){ context.rotate(Math.PI / 3) context.beginPath() context.moveTo(0, 0) context.lineTo(0, branchSize) context.stroke() context.beginPath() context.moveTo(0, branchSize * 0.3) context.lineTo(branchSize * 0.3, branchSize * 0.5) context.stroke() context.beginPath() context.moveTo(0, branchSize * 0.5) context.lineTo(-branchSize * 0.3, branchSize * 0.7) context.stroke() context.beginPath() context.moveTo(0, branchSize * 0.7) context.lineTo(branchSize * 0.3, branchSize * 0.9) context.stroke() } context.restore() }