<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'>
Thanks!<br>I decided to draw a circle on the line AB, close to B. That would determine the direction.<br>However, I have problem drawing the circle while drawing the line. Consider the following<br>block from the while loop:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cairo_move_to (cr, *firstIter, *(firstIter+1));<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; cairo_line_to (cr, *secondIter, *(secondIter+1));<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // here I calculate the coordinates of the wished circles...<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; cairo_stroke(cr);<br>Note that placing <br>cairo_arc(cr, rectOrigin[0], rectOrigin[1], circleRad*0.5, 0, 2*M_PI);<br>instead of comment above leads to unwanted results.<br>What would be the way to draw these circles (given their origins) while drawing lines?<br>Thanks<br><br><br><br>From: jeremy@emperorlinux.com<br>To: cairo@cairographics.org<br>Date: Wed, 24 Nov 2010 23:42:45 -0500<br>Subject: Re: [cairo] Drawing an arrow<br><br><pre>On Tue, 2010-11-23 at 16:27 +0000, necko necko wrote:<br>&gt; A set of 2D coordinates needs be connected by lines, but some of these<br>&gt; lines need be arrows;<br>&gt; meaning, the sequence<br>&gt; <br>&gt;     cairo_move_to (cr, A.x, A.y);<br>&gt;     cairo_line_to (cr, B.x, B.y);<br>&gt; <br>&gt; that draws a line from A to B, needs to be replaced with an arrow from<br>&gt; A to B.<br>&gt; Any help on how to achieve this is highly welcome.<br>&gt; Thanks<br> <br>It turns out, Behdad has already provided some code that does something<br>very similar to this! I include the code in Cairocks, the function is<br>called "map_path_onto" and I got it from some of his code... somewhere.<br> <br>Please see the attached image for a demonstration. I only use a simple<br>arc as the path, but you could just as well use anything.<br> <br>Weee! :)<br> <br>&gt; --<br>&gt; cairo mailing list<br>&gt; cairo@cairographics.org<br>&gt; <a href="http://lists.cairographics.org/mailman/listinfo/cairo" target="_blank">http://lists.cairographics.org/mailman/listinfo/cairo</a><br> <br> <br></pre><br>--
cairo mailing list
cairo@cairographics.org
http://lists.cairographics.org/mailman/listinfo/cairo                                               </body>
</html>