Mercurial > 510Connectbot
comparison src/de/mud/terminal/VDUBuffer.java @ 123:446dbcf606eb
add more 5250 config items; ignore drawing outside the screen
author | Carl Byington <carl@five-ten-sg.com> |
---|---|
date | Thu, 19 Jun 2014 08:28:23 -0700 |
parents | bf01d1eec5c6 |
children | 6eab98e58bed |
comparison
equal
deleted
inserted
replaced
122:52b1d0ee27b1 | 123:446dbcf606eb |
---|---|
156 * @see #deleteChar | 156 * @see #deleteChar |
157 * @see #redraw | 157 * @see #redraw |
158 */ | 158 */ |
159 | 159 |
160 public void putChar(int c, int l, char ch, int attributes) { | 160 public void putChar(int c, int l, char ch, int attributes) { |
161 charArray[screenBase + l][c] = ch; | 161 int ll = screenBase + l; |
162 charAttributes[screenBase + l][c] = attributes; | 162 if ((ll >= bufSize) || (c >= width)) return; // ignore characters outside our buffer |
163 charArray[ll][c] = ch; | |
164 charAttributes[ll][c] = attributes; | |
163 | 165 |
164 if (l < height) | 166 if (l < height) |
165 update[l + 1] = true; | 167 update[l + 1] = true; |
166 } | 168 } |
167 | 169 |
584 * Puts the cursor at the specified position. | 586 * Puts the cursor at the specified position. |
585 * @param c column | 587 * @param c column |
586 * @param l line | 588 * @param l line |
587 */ | 589 */ |
588 public void setCursorPosition(int c, int l) { | 590 public void setCursorPosition(int c, int l) { |
589 cursorX = c; | 591 cursorX = min(width-1, c); |
590 cursorY = l; | 592 cursorY = min(height-1, l); |
591 } | 593 } |
592 | 594 |
593 /** | 595 /** |
594 * Get the current column of the cursor position. | 596 * Get the current column of the cursor position. |
595 */ | 597 */ |