]> O.S.I.I.S - jp/vkvg.git/commitdiff
implement svg from fragment for vkvg-svg
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Tue, 11 Jan 2022 15:39:21 +0000 (16:39 +0100)
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Tue, 11 Jan 2022 15:39:21 +0000 (16:39 +0100)
external/vkvg-svg
include/vkvg-svg.h
src/vkvg_context_internal.c

index 4acb2090ee4f966c74298344646b3d33076e0e21..98dd8e145744f06865ec964e9cae9c9dea461668 160000 (submodule)
@@ -1 +1 @@
-Subproject commit 4acb2090ee4f966c74298344646b3d33076e0e21
+Subproject commit 98dd8e145744f06865ec964e9cae9c9dea461668
index e35e168f306445d48c1d908346773540751a9920..b325c72bce7430a0265f4d6ee482fa834220f271 100644 (file)
@@ -48,7 +48,7 @@ VkvgSurface vkvg_surface_create_from_svg(VkvgDevice dev, uint32_t width, uint32_
  * @return The new vkvg surface with the parsed SVG fragment as content, or null if an error occured.
  */
 vkvg_public
-VkvgSurface vkvg_surface_create_from_svg_fragment(VkvgDevice dev, uint32_t width, uint32_t height, char* svgFragment);
+VkvgSurface vkvg_surface_create_from_svg_fragment(VkvgDevice dev, uint32_t width, uint32_t height, const char* svgFragment);
 
 #ifndef VKVG_SVG
 /*! @defgroup nsvg Nano SVG
index d5b4981bd7f4b904e2512826561987575ebe8aaa..b0a32fbf295b4e81195573f964065f739ca5095c 100644 (file)
@@ -711,8 +711,7 @@ void _update_cur_pattern (VkvgContext ctx, VkvgPattern pat) {
                ctx->pushConsts.source = bounds;
 
                //transform control point with current ctx matrix
-               vkvg_gradient_t grad = {0};
-               memcpy (&grad, pat->data, sizeof(vkvg_gradient_t));
+               vkvg_gradient_t grad = *(vkvg_gradient_t*)pat->data;
 
                if (grad.count < 2) {
                        ctx->status = VKVG_STATUS_PATTERN_INVALID_GRADIENT;