Skip to content

Commit 6323fbd

Browse files
committed
Fix elliptical gradient transform
1 parent 4709219 commit 6323fbd

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

utils.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,8 @@ func NewEllipticalGray16(w, h int, c []float64, rx, ry, th float64, wf *NonLinea
4343
nl := NewNLWave([]float64{rx}, []*NonLinear{wf}, mirror, once)
4444
f1 := NewRadialGradient(nl)
4545
// Reverse order
46-
xfm := g2d.Translate(c[0], c[1])
47-
xfm.Rotate(th)
48-
xfm.Scale(1, ry/rx)
46+
xfm := g2d.Scale(1, rx/ry)
47+
xfm.Rotate(-th)
4948
xfm.Translate(-c[0], -c[1])
5049
f2 := NewTransform(f1, xfm)
5150
return NewTextureGray16(w, h, f2, 0, 0, 1, 1, false)

0 commit comments

Comments
 (0)