Skip to content

Commit

Permalink
ui/vc: fold text_update_xy()
Browse files Browse the repository at this point in the history
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Message-Id: <20230830093843.3531473-15-marcandre.lureau@redhat.com>
  • Loading branch information
elmarco committed Sep 4, 2023
1 parent 3be82c6 commit d7c634a
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions ui/console.c
Original file line number Diff line number Diff line change
Expand Up @@ -425,14 +425,6 @@ static void text_console_resize(QemuConsole *s)
s->cells = cells;
}

static inline void text_update_xy(QemuConsole *s, int x, int y)
{
s->text_x[0] = MIN(s->text_x[0], x);
s->text_x[1] = MAX(s->text_x[1], x);
s->text_y[0] = MIN(s->text_y[0], y);
s->text_y[1] = MAX(s->text_y[1], y);
}

static void invalidate_xy(QemuConsole *s, int x, int y)
{
if (!qemu_console_is_visible(s)) {
Expand All @@ -453,7 +445,10 @@ static void update_xy(QemuConsole *s, int x, int y)
TextCell *c;
int y1, y2;

text_update_xy(s, x, y);
s->text_x[0] = MIN(s->text_x[0], x);
s->text_x[1] = MAX(s->text_x[1], x);
s->text_y[0] = MIN(s->text_y[0], y);
s->text_y[1] = MAX(s->text_y[1], y);

y1 = (s->y_base + y) % s->total_height;
y2 = y1 - s->y_displayed;
Expand Down

0 comments on commit d7c634a

Please sign in to comment.