Add msdf_shape_orient_contours function

This commit is contained in:
KitsuneAlex 2024-05-10 05:14:48 +02:00
parent de0d52a9be
commit 382164d4e6
No known key found for this signature in database
GPG Key ID: 6B0CE864BB69B7D0
2 changed files with 11 additions and 0 deletions

View File

@ -281,6 +281,11 @@ MSDF_API int msdf_shape_bound_miters(msdf_shape_const_handle shape,
return MSDF_SUCCESS; return MSDF_SUCCESS;
} }
MSDF_API int msdf_shape_orient_contours(msdf_shape_handle shape) {
reinterpret_cast<msdfgen::Shape*>(shape)->orientContours();
return MSDF_SUCCESS;
}
MSDF_API void msdf_shape_free(msdf_shape_handle shape) { MSDF_API void msdf_shape_free(msdf_shape_handle shape) {
msdf_delete(reinterpret_cast<msdfgen::Shape*>(shape)); msdf_delete(reinterpret_cast<msdfgen::Shape*>(shape));
} }

View File

@ -292,6 +292,12 @@ MSDF_API int msdf_shape_bound(msdf_shape_const_handle shape, msdf_bounds_t* boun
*/ */
MSDF_API int msdf_shape_bound_miters(msdf_shape_const_handle shape, msdf_bounds_t* bounds, double border, double miter_limit, int polarity); MSDF_API int msdf_shape_bound_miters(msdf_shape_const_handle shape, msdf_bounds_t* bounds, double border, double miter_limit, int polarity);
/**
* Orients all contours associated with the given shape before rendering.
* @param shape A pointer to a shape whose contours to orient.
*/
MSDF_API int msdf_shape_orient_contours(msdf_shape_handle shape);
/** /**
* Calls the destructor of the given bitmap and frees its memory using the * Calls the destructor of the given bitmap and frees its memory using the
* internal allocator. * internal allocator.