Unlock custom brushes, natural fill effects and intuitive hatching in p5.js
Doc fixes
Alejandro2c443faf5bdd
diff --git a/README.md b/README.mdindex 57e4a95..bfc9d74 100644--- a/README.md+++ b/README.md@@ -888,7 +888,7 @@ This section covers functions for initializing the drawing system, preloading re- **Example (load p5.brush on buffer)**:```javascriptfunction setup() {- createCanvas(400,400,WEBGL)+ createCanvas(400, 400, WEBGL)// Draw stuff to global canvasbrush.set("HB","black",1)brush.rect(40,40,150,100)@@ -896,7 +896,7 @@ This section covers functions for initializing the drawing system, preloading rebrush.reDraw()// Create buffer- let buffer = createGraphics(200,300)+ let buffer = createGraphics(200, 300, WEBGL)brush.load(buffer)brush.set("HB","black",1)brush.rect(40,40,150,100)diff --git a/src/index.js b/src/index.jsindex eb758eb..f4ad8a9 100644--- a/src/index.js+++ b/src/index.js@@ -2096,13 +2096,13 @@let p = new Plot("curve")// Calculate start angle and end anglelet a1 = 270 - R.toDegrees(start), a2 = 270 - R.toDegrees(end);- // Calcualte length arc+ // Calculate length arclet arcAngle = R.toDegrees(end - start);let l = Math.PI * radius * arcAngle / 180;// Add segments to plotp.addSegment(a1, l, 1, true)p.endPlot(a2, 1, true)- // Fill / hatch / draw+ // Draw from starting pointp.draw(x + radius * R.cos(- a1 - 90),y + radius * R.sin(- a1 - 90),1)}