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

Function rightMost

plot.go:280–293  ·  view source on GitHub ↗

rightMost returns the right-most GlyphBox.

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

Source from the content-addressed store, hash-verified

278
279// rightMost returns the right-most GlyphBox.
280func rightMost(c *draw.Canvas, boxes []GlyphBox) GlyphBox {
281 maxx := c.Max.X
282 r := GlyphBox{X: 1}
283 for _, b := range boxes {
284 if b.Size().X <= 0 {
285 continue
286 }
287 if x := c.X(b.X) + b.Min.X + b.Size().X; x > maxx && b.X <= 1 {
288 maxx = x
289 r = b
290 }
291 }
292 return r
293}
294
295// leftMost returns the left-most GlyphBox.
296func leftMost(c *draw.Canvas, boxes []GlyphBox) GlyphBox {

Callers 1

padXFunction · 0.85

Calls 2

SizeMethod · 0.65
XMethod · 0.65

Tested by

no test coverage detected