[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [47449] trunk/blender/source/blender/ blenkernel/intern/mask.c: mask switch direction now swaps handle direction too

Campbell Barton ideasman42 at gmail.com
Tue Jun 5 09:01:44 CEST 2012


Revision: 47449
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=47449
Author:   campbellbarton
Date:     2012-06-05 07:01:43 +0000 (Tue, 05 Jun 2012)
Log Message:
-----------
mask switch direction now swaps handle direction too

Modified Paths:
--------------
    trunk/blender/source/blender/blenkernel/intern/mask.c

Modified: trunk/blender/source/blender/blenkernel/intern/mask.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/mask.c	2012-06-05 06:54:18 UTC (rev 47448)
+++ trunk/blender/source/blender/blenkernel/intern/mask.c	2012-06-05 07:01:43 UTC (rev 47449)
@@ -383,16 +383,27 @@
 	const int tot_uw_half = tot_uw / 2;
 	int i;
 
-	if (tot_uw < 2) {
-		return;
+	float co_tmp[2];
+
+	/* swap handles */
+	copy_v2_v2(co_tmp, point->bezt.vec[0]);
+	copy_v2_v2(point->bezt.vec[0], point->bezt.vec[2]);
+	copy_v2_v2(point->bezt.vec[2], co_tmp);
+	/* in this case the flags are unlikely to be different but swap anyway */
+	SWAP(char, point->bezt.f1, point->bezt.f3);
+	SWAP(char, point->bezt.h1, point->bezt.h2);
+
+
+	/* swap UW's */
+	if (tot_uw > 1) {
+		/* count */
+		for (i = 0; i < tot_uw_half; i++) {
+			MaskSplinePointUW *uw_a = &point->uw[i];
+			MaskSplinePointUW *uw_b = &point->uw[tot_uw - (i + 1)];
+			SWAP(MaskSplinePointUW, *uw_a, *uw_b);
+		}
 	}
 
-	/* count */
-	for (i = 0; i < tot_uw_half; i++) {
-		MaskSplinePointUW *uw_a = &point->uw[i];
-		MaskSplinePointUW *uw_b = &point->uw[tot_uw - (i + 1)];
-		SWAP(MaskSplinePointUW, *uw_a, *uw_b);
-	}
 	for (i = 0; i < tot_uw; i++) {
 		MaskSplinePointUW *uw = &point->uw[i];
 		uw->u = 1.0f - uw->u;




More information about the Bf-blender-cvs mailing list