Skip to content

Commit

Permalink
Renamed SprayBrush to SprayPaintBrush
Browse files Browse the repository at this point in the history
  • Loading branch information
av01d committed Jun 3, 2021
1 parent 86c8c93 commit fd196f4
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ A collection of brushes for fabric.js (version 4 and up).
- Ribbon
- Shaded
- Sketchy
- Spray
- SprayPaint
- Squares
- Web

Expand All @@ -33,7 +33,7 @@ A collection of brushes for fabric.js (version 4 and up).
[<img src="https://av01d.github.io/fabric-brushes/img/brush.ribbon.gif" alt="Ribbon brush" width="640" height="320">](https://av01d.github.io/fabric-brush)
[<img src="https://av01d.github.io/fabric-brushes/img/brush.shaded.gif" alt="Shaded brush" width="640" height="320">](https://av01d.github.io/fabric-brush)
[<img src="https://av01d.github.io/fabric-brushes/img/brush.sketchy.gif" alt="Sketchy brush" width="640" height="320">](https://av01d.github.io/fabric-brush)
[<img src="https://av01d.github.io/fabric-brushes/img/brush.spray.gif" alt="Spray brush" width="640" height="320">](https://av01d.github.io/fabric-brush)
[<img src="https://av01d.github.io/fabric-brushes/img/brush.spraypaint.gif" alt="SprayPaint brush" width="640" height="320">](https://av01d.github.io/fabric-brush)
[<img src="https://av01d.github.io/fabric-brushes/img/brush.squares.gif" alt="Squares brush" width="640" height="320">](https://av01d.github.io/fabric-brush)
[<img src="https://av01d.github.io/fabric-brushes/img/brush.web.gif" alt="Web brush" width="640" height="320">](https://av01d.github.io/fabric-brush)

Expand Down Expand Up @@ -149,9 +149,9 @@ fabricCanvas.freeDrawingBrush = new fabric.SketchyBrush(fabricCanvas,
});
```

### SprayBrush
### SprayPaintBrush
```js
fabricCanvas.freeDrawingBrush = new fabric.SprayBrush(fabricCanvas,
fabricCanvas.freeDrawingBrush = new fabric.SprayPaintBrush(fabricCanvas,
{
width: 30, // Width of brush
color: '#000', // Color of brush
Expand Down
8 changes: 4 additions & 4 deletions dist/fabric.brushes.js
Original file line number Diff line number Diff line change
Expand Up @@ -814,10 +814,10 @@ fabric.SketchyBrush = fabric.util.createClass(fabric.BaseBrush, {
}); // End SketchyBrush

/**
* SprayBrush
* SprayPaintBrush
* Based on code by Tennison Chan.
*/
fabric.SprayBrush = fabric.util.createClass(fabric.BaseBrush, {
fabric.SprayPaintBrush = fabric.util.createClass(fabric.BaseBrush, {
color: '#000',
opacity: 1,
width: 30,
Expand Down Expand Up @@ -918,7 +918,7 @@ fabric.SprayBrush = fabric.util.createClass(fabric.BaseBrush, {
this._point = null;
this._lastPoint = null;
}
}); // End Spraybrush
}); // End SprayPaintBrush

/**
* SquaresBrush
Expand Down Expand Up @@ -1057,4 +1057,4 @@ fabric.WebBrush = fabric.util.createClass(fabric.BaseBrush, {
_render: function() {}
}); // End WebBrush

})(typeof fabric !== 'undefined' ? fabric : require('fabric').fabric);
})(typeof fabric !== 'undefined' ? fabric : require('fabric').fabric);
2 changes: 1 addition & 1 deletion dist/fabric.brushes.min.js

Large diffs are not rendered by default.

Binary file added img/brush.spraypaint.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 6 additions & 6 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -535,11 +535,11 @@ <h2>Sketchy Brush</h2>
&lt;/script&gt;
</code></pre>

<!------------------------------------- Spray ------------------------------------->
<!------------------------------------- SprayPaint ------------------------------------->

<h2>Spray Brush</h2>
<h2>SprayPaint Brush</h2>
<div class="canvas-wrap">
<canvas id="spray-canvas"></canvas>
<canvas id="spraypaint-canvas"></canvas>
</div>

<script>
Expand All @@ -550,7 +550,7 @@ <h2>Spray Brush</h2>
width: 30,
opacity: 1
},
fabricCanvas = getFabricCanvas(canvasID, 'SprayBrush', brushOpts),
fabricCanvas = getFabricCanvas(canvasID, 'SprayPaintBrush', brushOpts),
dat = DatGui(brushOpts, fabricCanvas),
gui = dat.getGui();

Expand All @@ -570,7 +570,7 @@ <h2>Spray Brush</h2>
dat.addButtons();

fabricCanvas.getElement().parentNode.parentNode.appendChild(gui.domElement);
})('spray-canvas');
})('spraypaint-canvas');

</script>

Expand All @@ -581,7 +581,7 @@ <h2>Spray Brush</h2>
isDrawingMode: true
});

fabricCanvas.freeDrawingBrush = new fabric.SprayBrush(fabricCanvas, {width:30, color:'#4598a9', opacity:1});
fabricCanvas.freeDrawingBrush = new fabric.SprayPaintBrush(fabricCanvas, {width:30, color:'#4598a9', opacity:1});
&lt;/script&gt;
</code></pre>

Expand Down

0 comments on commit fd196f4

Please sign in to comment.