The writeable area of the view is always two less then the view's size, because if it has a frame, we need to subtract that, but if it doesn't, the view is made 1 larger on all sides. I'd like to clean this up at some point, but for now we live with this weirdness.
()
| 529 | // view is made 1 larger on all sides. I'd like to clean this up at some point, |
| 530 | // but for now we live with this weirdness. |
| 531 | func (v *View) InnerWidth() int { |
| 532 | innerWidth := v.Width() - 2 |
| 533 | if innerWidth < 0 { |
| 534 | return 0 |
| 535 | } |
| 536 | |
| 537 | return innerWidth |
| 538 | } |
| 539 | |
| 540 | func (v *View) InnerHeight() int { |
| 541 | innerHeight := v.Height() - 2 |