Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Allow filling paths in drawPath.

  • Loading branch information...
commit 0043a9c74beb89034459561a0a8d27efdd7183e6 1 parent 0ee3077
@deanm authored
Showing with 8 additions and 3 deletions.
  1. +8 −3 pre3d.js
View
11 pre3d.js
@@ -1023,8 +1023,9 @@ Pre3d = (function() {
// z-sorting. There is currently no filling, paths are only stroked. To
// control the render state, you should modify ctx directly, and set whatever
// properties you want (stroke color, etc). The drawing happens immediately.
- Renderer.prototype.drawPath = function drawPath(path) {
+ Renderer.prototype.drawPath = function drawPath(path, opts) {
var ctx = this.ctx;
+ var opts = opts || { };
var t = multiplyAffine(this.camera.transform.getMatrix(),
this.transform.getMatrix());
@@ -1056,8 +1057,12 @@ Pre3d = (function() {
}
}
- // We've connected all our Curves into a <canvas> path, now stroke it all.
- ctx.stroke();
+ // We've connected all our Curves into a <canvas> path, now draw it.
+ if (opts.fill === true) {
+ ctx.fill();
+ } else {
+ ctx.stroke();
+ }
};
return {
Please sign in to comment.
Something went wrong with that request. Please try again.