Change msdf_shape_add_contour to use a const handle

This commit is contained in:
KitsuneAlex 2024-05-06 23:50:41 +02:00
parent ef7cdfcb69
commit de0d52a9be
No known key found for this signature in database
GPG Key ID: 6B0CE864BB69B7D0
2 changed files with 3 additions and 3 deletions

View File

@ -205,11 +205,11 @@ MSDF_API int msdf_shape_get_bounds(msdf_shape_const_handle shape, msdf_bounds_t*
return MSDF_SUCCESS; return MSDF_SUCCESS;
} }
MSDF_API int msdf_shape_add_contour(msdf_shape_handle shape, msdf_contour_handle contour) { MSDF_API int msdf_shape_add_contour(msdf_shape_handle shape, msdf_contour_const_handle contour) {
if(shape == nullptr || contour == nullptr) { if(shape == nullptr || contour == nullptr) {
return MSDF_ERR_INVALID_ARG; return MSDF_ERR_INVALID_ARG;
} }
reinterpret_cast<msdfgen::Shape*>(shape)->addContour(*reinterpret_cast<msdfgen::Contour*>(contour)); reinterpret_cast<msdfgen::Shape*>(shape)->addContour(*reinterpret_cast<const msdfgen::Contour*>(contour));
return MSDF_SUCCESS; return MSDF_SUCCESS;
} }

View File

@ -221,7 +221,7 @@ MSDF_API int msdf_shape_get_bounds(msdf_shape_const_handle shape, msdf_bounds_t*
* @param contour A pointer to the contour to add to the shape. * @param contour A pointer to the contour to add to the shape.
* @returns @code MSDF_SUCCESS@endcode on success, otherwise one of the constants prefixed with @code MSDF_ERR_@endcode. * @returns @code MSDF_SUCCESS@endcode on success, otherwise one of the constants prefixed with @code MSDF_ERR_@endcode.
*/ */
MSDF_API int msdf_shape_add_contour(msdf_shape_handle shape, msdf_contour_handle contour); MSDF_API int msdf_shape_add_contour(msdf_shape_handle shape, msdf_contour_const_handle contour);
/** /**
* Retrieves the number of contours allocated within the given shape object. * Retrieves the number of contours allocated within the given shape object.