Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions axis.go
Original file line number Diff line number Diff line change
Expand Up @@ -566,17 +566,11 @@ func (DefaultTicks) Ticks(min, max float64) []Tick {
}

func minInt(a, b int) int {
if a < b {
return a
}
return b
return min(a, b)
}

func maxInt(a, b int) int {
if a > b {
return a
}
return b
return max(a, b)
}

// LogTicks is suitable for the Tick.Marker field of an Axis,
Expand Down
11 changes: 2 additions & 9 deletions plotter/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,13 @@ func (img *Image) transformFor(p *plot.Plot) image.Image {
cTrans := int(p.X.Norm(img.x(c)) * float64(img.cols))
// Find the equivalent column of the previous image column after applying
// axis transforms.
cPrevTrans := int(p.X.Norm(img.x(maxInt(c-1, 0))) * float64(img.cols))
cPrevTrans := int(p.X.Norm(img.x(max(c-1, 0))) * float64(img.cols))
for r := range img.rows {
// Find the equivalent image row after applying axis transforms.
rTrans := int(p.Y.Norm(img.y(r)) * float64(img.rows))
// Find the equivalent row of the previous image row after applying
// axis transforms.
rPrevTrans := int(p.Y.Norm(img.y(maxInt(r-1, 0))) * float64(img.rows))
rPrevTrans := int(p.Y.Norm(img.y(max(r-1, 0))) * float64(img.rows))
crColor := img.img.At(c, img.rows-r-1)
// Set all the pixels in the new image between (cPrevTrans, rPrevTrans)
// and (cTrans, rTrans) to the color at (c,r) in the original image.
Expand All @@ -112,13 +112,6 @@ func (img *Image) transformFor(p *plot.Plot) image.Image {
return o
}

func maxInt(a, b int) int {
if a > b {
return a
}
return b
}

func (img *Image) x(c int) float64 {
if c >= img.cols || c < 0 {
panic("plotter/image: illegal range")
Expand Down
7 changes: 0 additions & 7 deletions plotter/johnson.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,6 @@ func (j *johnson) unblock(u int) {
}
}

func min(a, b int) int {
if a < b {
return a
}
return b
}

// tarjan implements Tarjan's strongly connected component finding
// algorithm. The implementation is from the pseudocode at
//
Expand Down
7 changes: 0 additions & 7 deletions vg/vgimg/vgimg_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,13 +150,6 @@ func TestIssue540(t *testing.T) {
}

func TestIssue687(t *testing.T) {
min := func(a, b int) int {
if a < b {
return a
}
return b
}

const (
fname = "testdata/issue687.png"
size = 500
Expand Down
Loading