mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-03-14 00:39:57 -04:00
Only try to simplfy path if there are more than two segments in it.
This commit is contained in:
parent
b0156c0e8b
commit
0eb033e6bf
1 changed files with 4 additions and 2 deletions
|
@ -736,8 +736,10 @@ var Path = this.Path = PathItem.extend(/** @lends Path# */{
|
|||
* }
|
||||
*/
|
||||
simplify: function(tolerance) {
|
||||
var fitter = new PathFitter(this, tolerance || 2.5);
|
||||
this.setSegments(fitter.fit());
|
||||
if (this._segments.length > 2) {
|
||||
var fitter = new PathFitter(this, tolerance || 2.5);
|
||||
this.setSegments(fitter.fit());
|
||||
}
|
||||
},
|
||||
|
||||
// TODO: reduceSegments([flatness])
|
||||
|
|
Loading…
Reference in a new issue