rightMost returns the right-most GlyphBox.
(c *draw.Canvas, boxes []GlyphBox)
| 278 | |
| 279 | // rightMost returns the right-most GlyphBox. |
| 280 | func 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. |
| 296 | func leftMost(c *draw.Canvas, boxes []GlyphBox) GlyphBox { |