Skip to content

Commit

Permalink
refactor(Output): add margins
Browse files Browse the repository at this point in the history
CC #26
  • Loading branch information
leon0399 committed Mar 28, 2023
1 parent 320174b commit 6c3a1e9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/output/output.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ namespace OH {
* @tparam _Tp The type of the point index.
*/
template <typename _Tp>
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);
}
Expand Down

0 comments on commit 6c3a1e9

Please sign in to comment.