Relayout images on screen resizes
The strategy is very simple, images are not rescaled or re-positioned in any way.
This commit is contained in:
parent
f9b52249d1
commit
3cce238b2b
@ -814,6 +814,11 @@ handle_delete_command(GraphicsManager *self, const GraphicsCommand *g, Cursor *c
|
|||||||
|
|
||||||
// }}}
|
// }}}
|
||||||
|
|
||||||
|
void
|
||||||
|
grman_resize(GraphicsManager *self, index_type UNUSED old_lines, index_type UNUSED lines, index_type UNUSED old_columns, index_type UNUSED columns) {
|
||||||
|
self->layers_dirty = true;
|
||||||
|
}
|
||||||
|
|
||||||
const char*
|
const char*
|
||||||
grman_handle_command(GraphicsManager *self, const GraphicsCommand *g, const uint8_t *payload, Cursor *c, bool *is_dirty) {
|
grman_handle_command(GraphicsManager *self, const GraphicsCommand *g, const uint8_t *payload, Cursor *c, bool *is_dirty) {
|
||||||
Image *image;
|
Image *image;
|
||||||
|
|||||||
@ -88,3 +88,4 @@ void grman_clear(GraphicsManager*);
|
|||||||
const char* grman_handle_command(GraphicsManager *self, const GraphicsCommand *g, const uint8_t *payload, Cursor *c, bool *is_dirty);
|
const char* grman_handle_command(GraphicsManager *self, const GraphicsCommand *g, const uint8_t *payload, Cursor *c, bool *is_dirty);
|
||||||
bool grman_update_layers(GraphicsManager *self, unsigned int scrolled_by, float screen_left, float screen_top, float dx, float dy, unsigned int num_cols, unsigned int num_rows);
|
bool grman_update_layers(GraphicsManager *self, unsigned int scrolled_by, float screen_left, float screen_top, float dx, float dy, unsigned int num_cols, unsigned int num_rows);
|
||||||
void grman_scroll_images(GraphicsManager *self, const ScrollData*);
|
void grman_scroll_images(GraphicsManager *self, const ScrollData*);
|
||||||
|
void grman_resize(GraphicsManager*, index_type, index_type, index_type, index_type);
|
||||||
|
|||||||
@ -149,14 +149,16 @@ screen_resize(Screen *self, unsigned int lines, unsigned int columns) {
|
|||||||
if (n == NULL) return false;
|
if (n == NULL) return false;
|
||||||
Py_CLEAR(self->main_linebuf); self->main_linebuf = n;
|
Py_CLEAR(self->main_linebuf); self->main_linebuf = n;
|
||||||
if (is_main) num_content_lines = num_content_lines_after;
|
if (is_main) num_content_lines = num_content_lines_after;
|
||||||
|
grman_resize(self->main_grman, self->lines, lines, self->columns, columns);
|
||||||
|
|
||||||
|
// Resize alt linebuf
|
||||||
n = realloc_lb(self->alt_linebuf, lines, columns, &num_content_lines_before, &num_content_lines_after, NULL);
|
n = realloc_lb(self->alt_linebuf, lines, columns, &num_content_lines_before, &num_content_lines_after, NULL);
|
||||||
if (n == NULL) return false;
|
if (n == NULL) return false;
|
||||||
Py_CLEAR(self->alt_linebuf); self->alt_linebuf = n;
|
Py_CLEAR(self->alt_linebuf); self->alt_linebuf = n;
|
||||||
|
|
||||||
// Resize alt linebuf
|
|
||||||
if (!is_main) num_content_lines = num_content_lines_after;
|
if (!is_main) num_content_lines = num_content_lines_after;
|
||||||
self->linebuf = is_main ? self->main_linebuf : self->alt_linebuf;
|
grman_resize(self->alt_grman, self->lines, lines, self->columns, columns);
|
||||||
|
|
||||||
|
self->linebuf = is_main ? self->main_linebuf : self->alt_linebuf;
|
||||||
self->lines = lines; self->columns = columns;
|
self->lines = lines; self->columns = columns;
|
||||||
self->margin_top = 0; self->margin_bottom = self->lines - 1;
|
self->margin_top = 0; self->margin_bottom = self->lines - 1;
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user