deprecated
(width uint16, height uint16)
| 69 | |
| 70 | // deprecated |
| 71 | func (buffer *Buffer) resizeView(width uint16, height uint16) { |
| 72 | |
| 73 | if buffer.viewHeight == 0 { |
| 74 | buffer.viewWidth = width |
| 75 | buffer.viewHeight = height |
| 76 | return |
| 77 | } |
| 78 | |
| 79 | // scroll to bottom |
| 80 | buffer.scrollLinesFromBottom = 0 |
| 81 | |
| 82 | if width < buffer.viewWidth { // wrap lines if we're shrinking |
| 83 | buffer.shrink(width) |
| 84 | buffer.grow(width) |
| 85 | } else if width > buffer.viewWidth { // unwrap lines if we're growing |
| 86 | buffer.grow(width) |
| 87 | } |
| 88 | |
| 89 | buffer.viewWidth = width |
| 90 | buffer.viewHeight = height |
| 91 | |
| 92 | buffer.resetVerticalMargins(uint(buffer.viewHeight)) |
| 93 | } |