From 39e9e6400b6b2174f0883611bd75e399b2e4a1fb Mon Sep 17 00:00:00 2001 From: Thomas Friedel Date: Mon, 23 Mar 2020 11:26:48 +0100 Subject: [PATCH] round coordinates when filling with image mask to improve text rendering --- backend/goglbackend/fill.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/goglbackend/fill.go b/backend/goglbackend/fill.go index 1b17bed..936e7c5 100644 --- a/backend/goglbackend/fill.go +++ b/backend/goglbackend/fill.go @@ -203,7 +203,7 @@ func (b *GoGLBackend) FillImageMask(style *backendbase.FillStyle, mask *image.Al var buf [16]float32 data := buf[:0] for _, pt := range pts { - data = append(data, float32(pt[0]), float32(pt[1])) + data = append(data, float32(math.Round(pt[0])), float32(math.Round(pt[1]))) } data = append(data, 0, 0, 0, float32(th), float32(tw), float32(th), float32(tw), 0)