canvas-extras
Advanced tools
Comparing version 1.0.6 to 1.0.7
@@ -32,3 +32,3 @@ const Canvas = require('canvas'); | ||
this.save(); | ||
this.beginPath() | ||
this.beginPath(); | ||
if (!emptyFillColor) emptyFillColor = 'black'; | ||
@@ -35,0 +35,0 @@ if (!barFillColor) barFillColor = 'white'; |
{ | ||
"name": "canvas-extras", | ||
"version": "1.0.6", | ||
"version": "1.0.7", | ||
"description": "Adds extra handy bits to canvas, including Progress Bars, rounded rectangles, and stadiums.", | ||
@@ -5,0 +5,0 @@ "main": "canvas-extras.js", |
@@ -19,5 +19,8 @@ canvas-extras adds extra handy bits to canvas, including Progress Bars, rounded rectangles, and stadiums. | ||
##### Note | ||
For the progress bar to work correctly, **do not** use any code that changes the bar's appearance (e.g. fill() or stroke()) as it will cause the bar to appear incorrectly. | ||
##### Example | ||
```javascript | ||
@@ -50,2 +53,21 @@ ctx.beginPath(); | ||
### Stadiums | ||
**Stadiums are also known as capsule shapes or pill shapes** | ||
ctx.stadium(x,y, width, height) | ||
##### Example | ||
```javascript | ||
ctx.beginPath(); | ||
ctx.fillStyle = '#aaaaaa'; | ||
ctx.stadium(50,50, 500, 100); | ||
ctx.fill(); | ||
ctx.closePath(); | ||
``` | ||
This will yield this result: | ||
![Image of stadium.] (https://rollbot.net/images/stadium.png) | ||
# Other bits | ||
@@ -52,0 +74,0 @@ |
5383
75