changeset 34:07c523c799f4

Fix bug of relative path command
author Thinker K.F. Li <thinker@branda.to>
date Wed, 06 Aug 2008 01:10:32 +0800
parents d82749f77108
children 581a03196093
files src/shape_path.c src/shape_rect.c
diffstat 2 files changed, 18 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/src/shape_path.c	Wed Aug 06 00:40:04 2008 +0800
+++ b/src/shape_path.c	Wed Aug 06 01:10:32 2008 +0800
@@ -464,10 +464,10 @@
 	case 'c':
 	    x1 = x + *args++;
 	    y1 = y + *args++;
-	    x2 = x1 + *args++;
-	    y2 = y1 + *args++;
-	    x = x2 + *args++;
-	    y = y2 + *args++;
+	    x2 = x + *args++;
+	    y2 = y + *args++;
+	    x = x + *args++;
+	    y = y + *args++;
 	    cairo_curve_to(cr, x1, y1, x2, y2, x, y);
 	    break;
 	case 'C':
@@ -482,10 +482,10 @@
 	case 's':
 	    x1 = x + x - x2;
 	    y1 = y + y - y2;
-	    x2 = x1 + *args++;
-	    y2 = y1 + *args++;
-	    x = x2 + *args++;
-	    y = y2 + *args++;
+	    x2 = x + *args++;
+	    y2 = y + *args++;
+	    x = x + *args++;
+	    y = y + *args++;
 	    cairo_curve_to(cr, x1, y1, x2, y2, x, y);
 	    break;
 	case 'S':
@@ -502,8 +502,8 @@
 	    y1 = y + *args++;
 	    x2 = x1;
 	    y2 = y1;
-	    x = x2 + *args++;
-	    y = y2 + *args++;
+	    x = x + *args++;
+	    y = y + *args++;
 	    cairo_curve_to(cr, x1, y1, x2, y2, x, y);
 	    break;
 	case 'Q':
@@ -520,8 +520,8 @@
 	    y1 = y + y - y2;
 	    x2 = x1;
 	    y2 = y1;
-	    x = x2 + *args++;
-	    y = y2 + *args++;
+	    x = x + *args++;
+	    y = y + *args++;
 	    cairo_curve_to(cr, x1, y1, x2, y2, x, y);
 	    break;
 	case 'T':
--- a/src/shape_rect.c	Wed Aug 06 00:40:04 2008 +0800
+++ b/src/shape_rect.c	Wed Aug 06 01:10:32 2008 +0800
@@ -6,5 +6,11 @@
     shape_t shape;
     co_aix x, y;
     co_aix rx, ry;
+    co_aix d_x, d_y;
+    co_aix d_rx, d_ry;
 } sh_rect_t;
 
+extern void sh_rect_transform(shape_t *shape) {
+    sh_rect_t *rect = (sh_rect_t *)shape;
+
+}