Skip to content

Commit 9b72afc

Browse files
committed
vxform: take external rand source
1 parent 9654b9f commit 9b72afc

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

vxform/rand.go

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@
55
package vxform
66

77
import (
8-
"math/rand"
9-
108
"cogentcore.org/core/math32/minmax"
9+
"cogentcore.org/lab/base/randx"
1110
)
1211

1312
// Rand specifies random transforms
@@ -27,10 +26,10 @@ type Rand struct {
2726
}
2827

2928
// Gen Generates new random transform values
30-
func (rx *Rand) Gen(xf *XForm) {
31-
trX := rx.TransX.ProjValue(rand.Float32())
32-
trY := rx.TransY.ProjValue(rand.Float32())
33-
sc := rx.Scale.ProjValue(rand.Float32())
34-
rt := rx.Rot.ProjValue(rand.Float32())
29+
func (rx *Rand) Gen(xf *XForm, rnd *randx.SysRand) {
30+
trX := rx.TransX.ProjValue(rnd.Float32())
31+
trY := rx.TransY.ProjValue(rnd.Float32())
32+
sc := rx.Scale.ProjValue(rnd.Float32())
33+
rt := rx.Rot.ProjValue(rnd.Float32())
3534
xf.Set(trX, trY, sc, rt)
3635
}

0 commit comments

Comments
 (0)