Skip to content

Commit

Permalink
move the pathCommands out of render
Browse files Browse the repository at this point in the history
makes easier to override, extend the class.
  • Loading branch information
asturur authored Jul 22, 2016
1 parent f9782cf commit 9980c83
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/shapes/path.class.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
* @private
* @param {CanvasRenderingContext2D} ctx context to render path on
*/
_render: function(ctx) {
_renderPathCommands: function(ctx) {
var current, // current instruction
previous = null,
subpathStartX = 0,
Expand Down Expand Up @@ -446,6 +446,14 @@
}
previous = current;
}
},

/**
* @private
* @param {CanvasRenderingContext2D} ctx context to render path on
*/
_render: function(ctx) {
this._renderPathCommands(ctx);
this._renderFill(ctx);
this._renderStroke(ctx);
},
Expand Down

0 comments on commit 9980c83

Please sign in to comment.