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

Function topMost

plot.go:336–349  ·  view source on GitHub ↗

topMost returns the top-most GlyphBox.

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

Source from the content-addressed store, hash-verified

334
335// topMost returns the top-most GlyphBox.
336func topMost(c *draw.Canvas, boxes []GlyphBox) GlyphBox {
337 maxy := c.Max.Y
338 t := GlyphBox{Y: 1}
339 for _, b := range boxes {
340 if b.Size().Y <= 0 {
341 continue
342 }
343 if y := c.Y(b.Y) + b.Min.Y + b.Size().Y; y > maxy && b.Y <= 1 {
344 maxy = y
345 t = b
346 }
347 }
348 return t
349}
350
351// bottomMost returns the bottom-most GlyphBox.
352func bottomMost(c *draw.Canvas, boxes []GlyphBox) GlyphBox {

Callers 1

padYFunction · 0.85

Calls 2

SizeMethod · 0.65
YMethod · 0.65

Tested by

no test coverage detected