Skip to content

Commit

Permalink
Fix decimante points breaking point drawing in freedrawing (fabricjs#…
Browse files Browse the repository at this point in the history
  • Loading branch information
asturur authored Jun 22, 2019
1 parent d5b8ad6 commit f57ef4d
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/brushes/pencil_brush.class.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
* @private
*/
_reset: function() {
this._points.length = 0;
this._points = [];
this._setBrushStyles();
this._setShadow();
},
Expand Down Expand Up @@ -240,6 +240,9 @@
newPoints.push(lastPoint);
}
}
if (newPoints.length === 1) {
newPoints.push(new fabric.Point(newPoints[0].x, newPoints[0].y));
}
return newPoints;
},

Expand Down
54 changes: 53 additions & 1 deletion test/visual/freedraw.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added test/visual/golden/freedrawing5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added test/visual/golden/freedrawing6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit f57ef4d

Please sign in to comment.