Commit 34c8a59b authored by santiaago's avatar santiaago
Browse files

clean up un-used param 'key'

parent cb67fd4d
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@ func BannerRandom(w http.ResponseWriter, r *http.Request) {

	xt := extract.XTriangles(r)
	write.ImageSVG(w)
	isogrids.Random(w, "", colors, width, height, xt, prob)
	isogrids.Random(w, colors, width, height, xt, prob)
}

// BannerRandomGradinet handler for /isogrids/banner/random/gradient.
@@ -32,5 +32,5 @@ func BannerRandomGradient(w http.ResponseWriter, r *http.Request) {

	xt := extract.XTriangles(r)
	write.ImageSVG(w)
	isogrids.RandomGradient(w, "", colors, width, height, xt)
	isogrids.RandomGradient(w, colors, width, height, xt)
}
+1 −1
Original line number Diff line number Diff line
@@ -18,5 +18,5 @@ func Random(w http.ResponseWriter, r *http.Request) {
	size := extract.Size(r)
	lines := extract.Lines(r)
	write.ImageSVG(w)
	isogrids.Random(w, "", colors, size, size, lines, prob)
	isogrids.Random(w, colors, size, size, lines, prob)
}
+1 −1
Original line number Diff line number Diff line
@@ -14,5 +14,5 @@ func RandomMirror(w http.ResponseWriter, r *http.Request) {
	prob := extract.Probability(r, 1/float64(len(colors)))

	write.ImageSVG(w)
	isogrids.RandomMirror(w, "", colors, size, prob)
	isogrids.RandomMirror(w, colors, size, prob)
}
+3 −3
Original line number Diff line number Diff line
@@ -8,7 +8,7 @@ import (
	"github.com/taironas/tinygraphs/draw"
)

func Random(w http.ResponseWriter, key string, colors []color.RGBA, width, height, lines int, prob float64) {
func Random(w http.ResponseWriter, colors []color.RGBA, width, height, lines int, prob float64) {
	canvas := svg.New(w)
	canvas.Start(width, height)

@@ -50,7 +50,7 @@ func Random(w http.ResponseWriter, key string, colors []color.RGBA, width, heigh
}

// Random creates an isogrids svg image with half diagonals.
func RandomGradient(w http.ResponseWriter, key string, colors []color.RGBA, width, height, lines int) {
func RandomGradient(w http.ResponseWriter, colors []color.RGBA, width, height, lines int) {
	canvas := svg.New(w)
	canvas.Start(width, height)

@@ -94,7 +94,7 @@ func RandomGradient(w http.ResponseWriter, key string, colors []color.RGBA, widt
}

// RandomMirror builds an image with 10x10 grids of half diagonals
func RandomMirror(w http.ResponseWriter, key string, colors []color.RGBA, size int, prob float64) {
func RandomMirror(w http.ResponseWriter, colors []color.RGBA, size int, prob float64) {
	canvas := svg.New(w)
	canvas.Start(size, size)

+3 −3
Original line number Diff line number Diff line
@@ -9,7 +9,7 @@ import (
func TestRandom(t *testing.T) {

	rec := httptest.NewRecorder()
	Random(rec, key, colorTheme, 10, 10, 10, float64(50))
	Random(rec, colorTheme, 10, 10, 10, float64(50))
	if rec.Code != http.StatusOK {
		t.Errorf("returned %v. Expected %v.", rec.Code, http.StatusOK)
	}
@@ -18,7 +18,7 @@ func TestRandom(t *testing.T) {
func TestRandomGradient(t *testing.T) {

	rec := httptest.NewRecorder()
	RandomGradient(rec, key, colorTheme, 10, 10, 10)
	RandomGradient(rec, colorTheme, 10, 10, 10)
	if rec.Code != http.StatusOK {
		t.Errorf("returned %v. Expected %v.", rec.Code, http.StatusOK)
	}
@@ -27,7 +27,7 @@ func TestRandomGradient(t *testing.T) {
func TestRandomMirror(t *testing.T) {

	rec := httptest.NewRecorder()
	RandomMirror(rec, key, colorTheme, 10, float64(50))
	RandomMirror(rec, colorTheme, 10, float64(50))
	if rec.Code != http.StatusOK {
		t.Errorf("returned %v. Expected %v.", rec.Code, http.StatusOK)
	}