From 382164d4e600c1c962257f84132e6d53a7fd8830 Mon Sep 17 00:00:00 2001 From: KitsuneAlex Date: Fri, 10 May 2024 05:14:48 +0200 Subject: [PATCH] Add msdf_shape_orient_contours function --- core/msdfgen-c.cpp | 5 +++++ msdfgen-c.h | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/core/msdfgen-c.cpp b/core/msdfgen-c.cpp index 9b802c4..708eaba 100644 --- a/core/msdfgen-c.cpp +++ b/core/msdfgen-c.cpp @@ -281,6 +281,11 @@ MSDF_API int msdf_shape_bound_miters(msdf_shape_const_handle shape, return MSDF_SUCCESS; } +MSDF_API int msdf_shape_orient_contours(msdf_shape_handle shape) { + reinterpret_cast(shape)->orientContours(); + return MSDF_SUCCESS; +} + MSDF_API void msdf_shape_free(msdf_shape_handle shape) { msdf_delete(reinterpret_cast(shape)); } diff --git a/msdfgen-c.h b/msdfgen-c.h index 67ab638..65461f0 100644 --- a/msdfgen-c.h +++ b/msdfgen-c.h @@ -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); +/** + * 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 * internal allocator.