diff options
author | Benji Dial <benji@benjidial.net> | 2024-07-29 21:26:17 -0400 |
---|---|---|
committer | Benji Dial <benji@benjidial.net> | 2024-07-29 21:26:17 -0400 |
commit | c34b9191f258ddc15c5b45c000cd0266aed9dead (patch) | |
tree | 88e66004d1514d6f22b4366fc415b467784fee63 /applications/goldman/source/renderer.cpp | |
parent | e6c3a80b01ffb52079783cddd9be6d392d0f7039 (diff) | |
download | hilbert-os-c34b9191f258ddc15c5b45c000cd0266aed9dead.tar.gz |
window borders
Diffstat (limited to 'applications/goldman/source/renderer.cpp')
-rw-r--r-- | applications/goldman/source/renderer.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/applications/goldman/source/renderer.cpp b/applications/goldman/source/renderer.cpp index 629c375..7a5e6b5 100644 --- a/applications/goldman/source/renderer.cpp +++ b/applications/goldman/source/renderer.cpp @@ -52,9 +52,11 @@ void renderer::do_render() { for (auto it = windows.begin(); it != windows.end(); ++it) double_buffer.copy_from( - (*it)->contents, (*it)->x, (*it)->y, 0, 0, - std::min((*it)->contents.width, double_buffer.width - (*it)->x), - std::min((*it)->contents.height, double_buffer.height - (*it)->y)); + (*it)->contents_with_decorations, (*it)->x, (*it)->y, 0, 0, + std::min((*it)->contents_with_decorations.width, + double_buffer.width - (*it)->x), + std::min((*it)->contents_with_decorations.height, + double_buffer.height - (*it)->y)); double_buffer.convert_from( cursor_background, cursor, cursor_x, cursor_y, 0, 0, @@ -93,10 +95,15 @@ void renderer::bump_cursor(int x_offset, int y_offset) { } -void renderer::add_window(const window *w) { +void renderer::add_window(window *w) { + if (windows.size() != 0) + windows.back()->draw_decorations(false); + w->draw_decorations(true); windows.push_back(w); } -void renderer::remove_window(const window *w) { +void renderer::remove_window(window *w) { windows.remove(w); + if (windows.size() != 0) + windows.back()->draw_decorations(true); } |