leftMost returns the left-most GlyphBox.
(c *draw.Canvas, boxes []GlyphBox)
| 294 | |
| 295 | // leftMost returns the left-most GlyphBox. |
| 296 | func 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. |