From 597bc319bfc7efe5396142acac3c77616bd462bf Mon Sep 17 00:00:00 2001 From: Gavin Nishizawa Date: Tue, 24 Jan 2023 18:10:57 -0800 Subject: [PATCH] update other chopPrecision --- lib/svg/path.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/svg/path.go b/lib/svg/path.go index fa448d419..cc3ac8ef2 100644 --- a/lib/svg/path.go +++ b/lib/svg/path.go @@ -20,7 +20,8 @@ type SvgPathContext struct { // TODO probably use math.Big func chopPrecision(f float64) float64 { - return math.Round(f*10000) / 10000 + // bring down to float32 precision before rounding for consistency across architectures + return math.Round(float64(float32(f*10000)) / 10000) } func NewSVGPathContext(tl *geo.Point, sx, sy float64) *SvgPathContext {