fix shit
This commit is contained in:
@@ -206,11 +206,16 @@ static void cc_render_message_field(
|
|||||||
const unsigned int inner_w = w - x - 2;
|
const unsigned int inner_w = w - x - 2;
|
||||||
const unsigned int inner_h = h - y - 2;
|
const unsigned int inner_h = h - y - 2;
|
||||||
|
|
||||||
const int max_offset = messages.size > inner_h ? messages.size - inner_h : 0;
|
int max_offset = messages.size > inner_h ? messages.size - inner_h : 0;
|
||||||
if (render_state.scroll_offset > max_offset) render_state.scroll_offset = max_offset;
|
if (render_state.scroll_offset > max_offset)
|
||||||
|
render_state.scroll_offset = max_offset;
|
||||||
|
if (render_state.scroll_offset < 0)
|
||||||
|
render_state.scroll_offset = 0;
|
||||||
|
|
||||||
const int last = messages.size - render_state.scroll_offset;
|
int last = messages.size - render_state.scroll_offset;
|
||||||
const int first = last - inner_h > 0 ? last - inner_h : 0;
|
if (last < 0) last = 0;
|
||||||
|
int first = last - inner_h;
|
||||||
|
if (first < 0) first = 0;
|
||||||
|
|
||||||
for (int i = first; i < last; i++) {
|
for (int i = first; i < last; i++) {
|
||||||
mvprintw(y + 1 + (i - first), x + 1, "%-*.*s", inner_w, inner_w, messages.data[i]);
|
mvprintw(y + 1 + (i - first), x + 1, "%-*.*s", inner_w, inner_w, messages.data[i]);
|
||||||
|
|||||||
Reference in New Issue
Block a user