From c34b9191f258ddc15c5b45c000cd0266aed9dead Mon Sep 17 00:00:00 2001 From: Benji Dial Date: Mon, 29 Jul 2024 21:26:17 -0400 Subject: window borders --- applications/goldman/source/renderer.cpp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'applications/goldman/source/renderer.cpp') 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); } -- cgit v1.2.3