From 0b8d3dccb0cdbdc990900a97a53d9fe053c3e7a8 Mon Sep 17 00:00:00 2001 From: moodstubos Date: Fri, 2 Feb 2024 11:29:38 +0100 Subject: [PATCH] Update coordinate.dart set precision of coordinates see https://github.com/mohammedX6/poly_bool_dart/issues/6 --- lib/src/coordinate.dart | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/src/coordinate.dart b/lib/src/coordinate.dart index b182e38..57813a7 100644 --- a/lib/src/coordinate.dart +++ b/lib/src/coordinate.dart @@ -1,8 +1,11 @@ class Coordinate { - double x; - double y; + late double x; + late double y; - Coordinate(this.x, this.y); + Coordinate(double x, double y) { + this.x = double.parse(x.toStringAsFixed(5)); + this.y = double.parse(y.toStringAsFixed(5)); + } @override String toString() {