MCPcopy Index your code
hub / github.com/gonum/plot / leftMost

Function leftMost

plot.go:296–309  ·  view source on GitHub ↗

leftMost returns the left-most GlyphBox.

(c *draw.Canvas, boxes []GlyphBox)

Source from the content-addressed store, hash-verified

294
295// leftMost returns the left-most GlyphBox.
296func leftMost(c *draw.Canvas, boxes []GlyphBox) GlyphBox {
297 minx := c.Min.X
298 l := GlyphBox{}
299 for _, b := range boxes {
300 if b.Size().X <= 0 {
301 continue
302 }
303 if x := c.X(b.X) + b.Min.X; x < minx && b.X >= 0 {
304 minx = x
305 l = b
306 }
307 }
308 return l
309}
310
311// padY returns a draw.Canvas that is padded vertically
312// so that glyphs will no be clipped.

Callers 1

padXFunction · 0.85

Calls 2

SizeMethod · 0.65
XMethod · 0.65

Tested by

no test coverage detected