Only try to simplfy path if there are more than two segments in it.

This commit is contained in:
Jürg Lehni 2011-06-27 22:35:02 +02:00
parent b0156c0e8b
commit 0eb033e6bf

View file

@ -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])