Simplify drawSineCurve function

This commit is contained in:
Weilin Shi 2018-03-26 11:08:21 +08:00
parent d13db8c2b6
commit b204ba9578
1 changed files with 1 additions and 2 deletions

View File

@ -208,9 +208,8 @@ func drawSineCurve(img *image.NRGBA, opts *Options) {
curveHeight := float64(rng.Intn(opts.height/6) + opts.height/6) curveHeight := float64(rng.Intn(opts.height/6) + opts.height/6)
yStart := rng.Intn(opts.height*2/3) + opts.height/6 yStart := rng.Intn(opts.height*2/3) + opts.height/6
angle := 1.0 + rng.Float64() angle := 1.0 + rng.Float64()
flip := rng.Intn(2) == 0
yFlip := 1.0 yFlip := 1.0
if flip { if rng.Intn(2) == 0 {
yFlip = -1.0 yFlip = -1.0
} }
curveColor := randomInvertColor(opts.BackgroundColor) curveColor := randomInvertColor(opts.BackgroundColor)