From 6c3a1e9db40dd738921be544ca7bcb954416355a Mon Sep 17 00:00:00 2001 From: Leonid Meleshin Date: Tue, 28 Mar 2023 19:00:25 +0400 Subject: [PATCH] refactor(Output): add margins CC #26 --- lib/output/output.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/output/output.hpp b/lib/output/output.hpp index a798d07f..b1bea3c0 100644 --- a/lib/output/output.hpp +++ b/lib/output/output.hpp @@ -34,9 +34,9 @@ namespace OH { * @tparam _Tp The type of the point index. */ template - oh_output_point_t* mapPoint(_Tp x, _Tp y, _Tp x_max, _Tp y_max) { - const oh_output_coord_t x_coord = map(x, 0, x_max != 0 ? x_max : 1, 0, OH_OUTPUT_COORD_MAX); - const oh_output_coord_t y_coord = map(y, 0, y_max != 0 ? y_max : 1, 0, OH_OUTPUT_COORD_MAX); + inline oh_output_point_t* mapPoint(_Tp x, _Tp y, _Tp x_max, _Tp y_max) { + const oh_output_coord_t x_coord = map(x + 1, 0, x_max + 2, 0, OH_OUTPUT_COORD_MAX); + const oh_output_coord_t y_coord = map(y + 1, 0, y_max + 2, 0, OH_OUTPUT_COORD_MAX); return new oh_output_point_t(x_coord, y_coord); }