From 803812f9c92aaafb1936e8a274c5aacdc7a37a7d Mon Sep 17 00:00:00 2001 From: Sasha Koshka Date: Mon, 6 Mar 2023 21:40:20 -0500 Subject: [PATCH] Texture pattern now samples X position correctly --- artist/patterns/texture.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/artist/patterns/texture.go b/artist/patterns/texture.go index dd575b0..3c2b236 100644 --- a/artist/patterns/texture.go +++ b/artist/patterns/texture.go @@ -24,8 +24,11 @@ func (pattern Texture) Draw (destination canvas.Canvas, clip image.Rectangle) { srcPoint := bounds.Min.Sub(realBounds.Min).Add(srcBounds.Min) srcPoint.X = wrap(srcPoint.X, srcBounds.Min.X, srcBounds.Max.X) srcPoint.Y = wrap(srcPoint.Y, srcBounds.Min.Y, srcBounds.Max.Y) + srcPointXStart := srcPoint.X for dstPoint.Y = bounds.Min.Y; dstPoint.Y < bounds.Max.Y; dstPoint.Y ++ { + srcPoint.X = srcPointXStart + for dstPoint.X = bounds.Min.X; dstPoint.X < bounds.Max.X; dstPoint.X ++ { dstIndex := dstPoint.X + dstPoint.Y * dstStride srcIndex :=