[cairo-commit] [cairo-www] src/cookbook

Carl Worth cworth at freedesktop.org
Thu Aug 30 13:33:33 PDT 2007


 src/cookbook/roundedrectangles.mdwn |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 9c763828d84c7ed28d774bd32126e8ca437edaf2
Author: Carl Worth <cworth at annarchy.freedesktop.org>
Date:   Thu Aug 30 13:33:31 2007 -0700

    web commit by ionous: code was wrong, initial x and y positions needed to be added to x0 and y0 in roundedrecA

diff --git a/src/cookbook/roundedrectangles.mdwn b/src/cookbook/roundedrectangles.mdwn
index 036a25e..4608dbc 100644
--- a/src/cookbook/roundedrectangles.mdwn
+++ b/src/cookbook/roundedrectangles.mdwn
@@ -5,8 +5,8 @@ From the cairo samples, modified. Gives a very nice shape but takes width and he
     def roundedrecA(self,cr,x,y,width,height,radius=5):
         #/* a custom shape, that could be wrapped in a function */
         #radius = 5  #/*< and an approximate curvature radius */        
-        x0       = radius/2.0   #/*< parameters like cairo_rectangle */
-        y0       = radius/2.0
+        x0       = x+radius/2.0   #/*< parameters like cairo_rectangle */
+        y0       = y+radius/2.0
         rect_width  = width - radius
         rect_height = height - radius
         


More information about the cairo-commit mailing list