diff --git a/packages/core/src/path.js b/packages/core/src/path.js index d4981828207..10a9a4f4ea8 100644 --- a/packages/core/src/path.js +++ b/packages/core/src/path.js @@ -7,8 +7,7 @@ import { curvesIntersect, pointOnLine, pointOnCurve, - curveEdge, - round + curveEdge } from './utils' function Path(debug = false) { @@ -207,7 +206,7 @@ Path.prototype.length = function () { if (op.to) current = op.to } - return round(length) + return length } /** Returns the startpoint of the path */ diff --git a/packages/core/src/point.js b/packages/core/src/point.js index 569fd41ea69..fab11ccd5f5 100644 --- a/packages/core/src/point.js +++ b/packages/core/src/point.js @@ -1,9 +1,8 @@ import Attributes from './attributes' -import { round } from './utils' function Point(x, y, debug = false) { - this.x = round(x) - this.y = round(y) + this.x = x + this.y = y this.attributes = new Attributes() Object.defineProperty(this, 'debug', { value: debug, configurable: true }) } @@ -49,7 +48,7 @@ Point.prototype.dist = function (that) { let dx = this.x - that.x let dy = this.y - that.y - return round(Math.sqrt(Math.pow(dx, 2) + Math.pow(dy, 2))) + return Math.sqrt(Math.pow(dx, 2) + Math.pow(dy, 2)) } /** Returns slope of a line made by this point and that point */ diff --git a/packages/core/src/round.js b/packages/core/src/round.js deleted file mode 100644 index 1f734b3cccb..00000000000 --- a/packages/core/src/round.js +++ /dev/null @@ -1,3 +0,0 @@ -export default function round(value) { - return Math.round(value * 1e2) / 1e2 -}