topMost returns the top-most GlyphBox.
(c *draw.Canvas, boxes []GlyphBox)
| 334 | |
| 335 | // topMost returns the top-most GlyphBox. |
| 336 | func 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. |
| 352 | func bottomMost(c *draw.Canvas, boxes []GlyphBox) GlyphBox { |