From c4e1a9b13baf9a0f8b58824803c4a9e63cbc41b3 Mon Sep 17 00:00:00 2001 From: Vaxry Date: Sun, 5 Nov 2023 14:47:24 +0000 Subject: [PATCH] box: use std::round instead of std::floor in ::round() fixes #3761, possibly also #3511 --- src/helpers/Box.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/helpers/Box.cpp b/src/helpers/Box.cpp index e71ed622..55300f5f 100644 --- a/src/helpers/Box.cpp +++ b/src/helpers/Box.cpp @@ -58,12 +58,12 @@ CBox& CBox::applyFromWlr() { } CBox& CBox::round() { - float newW = x + w - std::floor(x); - float newH = y + h - std::floor(y); - x = std::floor(x); - y = std::floor(y); - w = std::floor(newW); - h = std::floor(newH); + float newW = x + w - std::round(x); + float newH = y + h - std::round(y); + x = std::round(x); + y = std::round(y); + w = std::round(newW); + h = std::round(newH); return *this; }