Bug 105118 - cairo-set-dash fails to pass along the dash vector argument
Summary: cairo-set-dash fails to pass along the dash vector argument
Status: RESOLVED FIXED
Alias: None
Product: guile-cairo
Classification: Unclassified
Component: General (show other bugs)
Version: unspecified
Hardware: All All
: medium major
Assignee: Andy Wingo
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-02-15 21:16 UTC by lloda
Modified: 2018-03-19 15:19 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description lloda 2018-02-15 21:16:28 UTC
As a result the function is rendered useless. Patch follows.

From 45315438ad31e1196a8d7f464615b5353f0b0e64 Mon Sep 17 00:00:00 2001
From: Daniel Llorens <daniel.llorens@bluewin.ch>
Date: Thu, 15 Feb 2018 22:09:38 +0100
Subject: [PATCH] Actually pass dash vector to cairo_set_dash

* guile-cairo/guile-cairo.c (scm_cairo_set_dash): Add missing conversion.
---
 guile-cairo/guile-cairo.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/guile-cairo/guile-cairo.c b/guile-cairo/guile-cairo.c
index 4a7a6db..ae97f3d 100644
--- a/guile-cairo/guile-cairo.c
+++ b/guile-cairo/guile-cairo.c
@@ -508,12 +508,15 @@ SCM_DEFINE_PUBLIC (scm_cairo_set_dash, "cairo-set-dash", 3, 0, 0,
                                    0, 1<<27);
   dashes = scm_malloc (ndashes * sizeof(double));
   scm_dynwind_free (dashes);
-    
+
+  for (int i=0; i<ndashes; ++i)
+      dashes[i] = scm_to_double (scm_c_vector_ref (sdashes, i));
+
   cairo_set_dash (scm_to_cairo (ctx),
                   dashes, ndashes, scm_to_double (offset));
 
   scm_dynwind_end ();
-    
+
   CCHKRET (ctx, SCM_UNSPECIFIED);
 }
 
-- 
2.15.1


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.