From 0b04af1fb30bfcc3d0e7b32ec4999ca1673e37c8 Mon Sep 17 00:00:00 2001 From: Relintai Date: Sat, 13 Jan 2024 15:48:15 +0100 Subject: [PATCH] Fixed clang format warnings. --- sfw/render_core/window.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/sfw/render_core/window.cpp b/sfw/render_core/window.cpp index 02a6543..6cb3256 100644 --- a/sfw/render_core/window.cpp +++ b/sfw/render_core/window.cpp @@ -559,8 +559,9 @@ uint64_t AppWindow::frame() { } void AppWindow::set_title(const char *title_) { snprintf(title, 128, "%s", title_); - if (!title[0]) + if (!title[0]) { glfwSetWindowTitle(_window, title); + } } void AppWindow::set_color(unsigned color) { unsigned r = (color >> 0) & 255; @@ -810,8 +811,9 @@ AppWindow::MouseMode AppWindow::get_mouse_mode() const { } void AppWindow::set_visible(int visible) { - if (!_window) + if (!_window) { return; + } //if(window) (visible ? glfwRestoreWindow : glfwIconifyWindow)(window); (visible ? glfwShowWindow : glfwHideWindow)(_window); @@ -829,8 +831,10 @@ double AppWindow::get_aspect() { return (double)w / (h + !h); } void AppWindow::aspect_lock(unsigned numer, unsigned denom) { - if (!_window) + if (!_window) { return; + } + if (numer * denom != 0) { glfwSetWindowAspectRatio(_window, numer, denom); } else { @@ -838,8 +842,10 @@ void AppWindow::aspect_lock(unsigned numer, unsigned denom) { } } void AppWindow::aspect_unlock() { - if (!_window) + if (!_window) { return; + } + AppWindow::aspect_lock(0, 0); }