Image display: Fix displaying images taller than two screen heights not scrolling properly

Fixes #194
This commit is contained in:
Kovid Goyal 2017-11-29 18:12:22 +05:30
parent f16bf2a136
commit 07b70f8c95
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 5 additions and 2 deletions

View File

@ -16,6 +16,9 @@ version 0.6.0 [future]
- Fix shift+up/down not rendering correct escape codes
- Image display: Fix displaying images taller than two screen heights not
scrolling properly
version 0.5.0 [2017-11-19]
---------------------------

View File

@ -436,7 +436,8 @@ screen_handle_graphics_command(Screen *self, const GraphicsCommand *cmd, const u
if (response != NULL) write_to_child(self, response, strlen(response));
if (x != self->cursor->x || y != self->cursor->y) {
if (self->cursor->x >= self->columns) { self->cursor->x = 0; self->cursor->y++; }
if (self->cursor->y > self->margin_bottom) { screen_scroll(self, self->cursor->y - self->margin_bottom); }
if (self->cursor->y > self->margin_bottom) screen_scroll(self, self->cursor->y - self->margin_bottom);
screen_ensure_bounds(self, false);
}
}
// }}}
@ -701,7 +702,6 @@ screen_index(Screen *self) {
void
screen_scroll(Screen *self, unsigned int count) {
// Scroll the screen up by count lines, not moving the cursor
count = MIN(self->lines, count);
unsigned int top = self->margin_top, bottom = self->margin_bottom;
while (count > 0) {
count--;