@@ -91,13 +91,13 @@ func (img *Image) transformFor(p *plot.Plot) image.Image {
9191 cTrans := int (p .X .Norm (img .x (c )) * float64 (img .cols ))
9292 // Find the equivalent column of the previous image column after applying
9393 // axis transforms.
94- cPrevTrans := int (p .X .Norm (img .x (maxInt (c - 1 , 0 ))) * float64 (img .cols ))
94+ cPrevTrans := int (p .X .Norm (img .x (max (c - 1 , 0 ))) * float64 (img .cols ))
9595 for r := range img .rows {
9696 // Find the equivalent image row after applying axis transforms.
9797 rTrans := int (p .Y .Norm (img .y (r )) * float64 (img .rows ))
9898 // Find the equivalent row of the previous image row after applying
9999 // axis transforms.
100- rPrevTrans := int (p .Y .Norm (img .y (maxInt (r - 1 , 0 ))) * float64 (img .rows ))
100+ rPrevTrans := int (p .Y .Norm (img .y (max (r - 1 , 0 ))) * float64 (img .rows ))
101101 crColor := img .img .At (c , img .rows - r - 1 )
102102 // Set all the pixels in the new image between (cPrevTrans, rPrevTrans)
103103 // and (cTrans, rTrans) to the color at (c,r) in the original image.
@@ -112,13 +112,6 @@ func (img *Image) transformFor(p *plot.Plot) image.Image {
112112 return o
113113}
114114
115- func maxInt (a , b int ) int {
116- if a > b {
117- return a
118- }
119- return b
120- }
121-
122115func (img * Image ) x (c int ) float64 {
123116 if c >= img .cols || c < 0 {
124117 panic ("plotter/image: illegal range" )
0 commit comments