diff options
author | Benji Dial <benji6283@gmail.com> | 2021-03-08 18:06:38 -0500 |
---|---|---|
committer | Benji Dial <benji6283@gmail.com> | 2021-03-08 18:06:38 -0500 |
commit | fd4557c4adddf710979a42e9f9d470bc8b3f77bd (patch) | |
tree | 485ff6f0514cc1918f8758927a1e2da2198e7d8a /src/user/raleigh/w/entry.cpp | |
parent | 920f1f010284d59bad86f78355ed90ac2f3e1d2c (diff) | |
download | portland-os-fd4557c4adddf710979a42e9f9d470bc8b3f77bd.tar.gz |
hbox, better painting logic in raleigh
Diffstat (limited to 'src/user/raleigh/w/entry.cpp')
-rw-r--r-- | src/user/raleigh/w/entry.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/user/raleigh/w/entry.cpp b/src/user/raleigh/w/entry.cpp index 1c6f91e..991d75a 100644 --- a/src/user/raleigh/w/entry.cpp +++ b/src/user/raleigh/w/entry.cpp @@ -9,8 +9,7 @@ namespace raleigh { const char *font, _pixel_t bg, _pixel_t fg, _pixel_t border_color) : rows(rows), cols(cols), bg(bg), fg(fg), border_color(border_color), fi(get_font(font)), data(new char[rows * cols]), - line_indices(new uint32_t[rows + 1]), first_paint(true), - has_focus(false) { + line_indices(new uint32_t[rows + 1]), has_focus(false) { size = coord(fi->space_width * (cols - 1) + fi->char_width + 6, fi->space_height * (rows - 1) + fi->char_height + 6); closest_opaque = this; @@ -78,7 +77,9 @@ namespace raleigh { _pixel_t *const cur_ptr = pixbuf + (window_offset.y + 3 + cur_y * fi->space_height) * pitch + (window_offset.x + 3 + cur_x * fi->space_width); _pixel_t *const old_cur_ptr = pixbuf + (window_offset.y + 3 + cur_y_last_paint * fi->space_height) * pitch + (window_offset.x + 3 + cur_x_last_paint * fi->space_width); - if (first_paint) { + if (next_paint_full) { + next_paint_full = false; + for (uint32_t x = 0; x < size.x; ++x) { pixbuf[(window_offset.y) * pitch + window_offset.x + x] = border_color; pixbuf[(window_offset.y + size.y - 1) * pitch + window_offset.x + x] = border_color; @@ -93,7 +94,6 @@ namespace raleigh { pixbuf[(window_offset.y + y) * pitch + (window_offset.x + x)] = bg; paint_text(pixbuf, pitch); - first_paint = false; } else if (text_changed_since_last_paint) { |