From c18abdbd32b4ad354c29eb6d60bc5b0c673428ec Mon Sep 17 00:00:00 2001 From: Antoine Lavenant Date: Fri, 17 May 2024 15:23:14 +0200 Subject: [PATCH] floor => ceil --- src/filter_grid_decimation/GridDecimationFilter.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/filter_grid_decimation/GridDecimationFilter.cpp b/src/filter_grid_decimation/GridDecimationFilter.cpp index 0461f6e..5f6fec9 100755 --- a/src/filter_grid_decimation/GridDecimationFilter.cpp +++ b/src/filter_grid_decimation/GridDecimationFilter.cpp @@ -107,8 +107,8 @@ void GridDecimationFilter::processOne(BOX2D bounds, PointRef& point, PointViewPt void GridDecimationFilter::createGrid(BOX2D bounds) { - double d_width = std::floor((bounds.maxx - bounds.minx) / m_args->m_edgeLength) + 1; - double d_height = std::floor((bounds.maxy - bounds.miny) / m_args->m_edgeLength) + 1; + double d_width = std::ceil((bounds.maxx - bounds.minx) / m_args->m_edgeLength); + double d_height = std::ceil((bounds.maxy - bounds.miny) / m_args->m_edgeLength); if (d_width < 0.0 || d_width > (std::numeric_limits::max)()) throwError("Grid width out of range.");