[xiph-commits] r10070 - trunk/planarity

xiphmont at svn.xiph.org xiphmont at svn.xiph.org
Mon Sep 26 00:28:49 PDT 2005


Author: xiphmont
Date: 2005-09-26 00:28:47 -0700 (Mon, 26 Sep 2005)
New Revision: 10070

Modified:
   trunk/planarity/graph.c
   trunk/planarity/version.h
Log:
Camilla found an unaccounted-for intersection corner case
(unintersecting perfect vertical compared to perfect horizontal)



Modified: trunk/planarity/graph.c
===================================================================
--- trunk/planarity/graph.c	2005-09-26 06:32:47 UTC (rev 10069)
+++ trunk/planarity/graph.c	2005-09-26 07:28:47 UTC (rev 10070)
@@ -254,31 +254,43 @@
       
     }else{
       // L vertical, M not vertical
-      float y = Ma*L1->x + Mb;
+      
+      // needed if L is vertical and M is horizontal
+      if(L1->x < M1->x && L1->x < M2->x) return 0;
+      if(L1->x > M1->x && L1->x > M2->x) return 0;
 
-      if(y < L1->y && y < L2->y) return 0;
-      if(y > L1->y && y > L2->y) return 0;
-      if(y < M1->y && y < M2->y) return 0;
-      if(y > M1->y && y > M2->y) return 0;
-
-      *xo = L1->x;
-      *yo=y;
-
+      {
+	float y = Ma*L1->x + Mb;
+	
+	if(y < L1->y && y < L2->y) return 0;
+	if(y > L1->y && y > L2->y) return 0;
+	if(y < M1->y && y < M2->y) return 0;
+	if(y > M1->y && y > M2->y) return 0;
+	
+	*xo = L1->x;
+	*yo=y;
+      }
     }
   }else{
 
     if(M1->x == M2->x){
       // M vertical, L not vertical
-      float y = La*M1->x + Lb;
 
-      if(y < L1->y && y < L2->y) return 0;
-      if(y > L1->y && y > L2->y) return 0;
-      if(y < M1->y && y < M2->y) return 0;
-      if(y > M1->y && y > M2->y) return 0;
+      // needed if L is vertical and M is horizontal
+      if(M1->x < L1->x && M1->x < L2->x) return 0;
+      if(M1->x > L1->x && M1->x > L2->x) return 0;
 
-      *xo = M1->x;
-      *yo=y;
-
+      {
+	float y = La*M1->x + Lb;
+	
+	if(y < L1->y && y < L2->y) return 0;
+	if(y > L1->y && y > L2->y) return 0;
+	if(y < M1->y && y < M2->y) return 0;
+	if(y > M1->y && y > M2->y) return 0;
+	
+	*xo = M1->x;
+	*yo=y;
+      }
     }else{
 
       // L and M both have non-infinite slope

Modified: trunk/planarity/version.h
===================================================================
--- trunk/planarity/version.h	2005-09-26 06:32:47 UTC (rev 10069)
+++ trunk/planarity/version.h	2005-09-26 07:28:47 UTC (rev 10070)
@@ -1,2 +1,2 @@
 #define VERSION "$Id$ "
-/* DO NOT EDIT: Automated versioning hack [Mon Sep 26 02:31:31 EDT 2005] */
+/* DO NOT EDIT: Automated versioning hack [Mon Sep 26 03:26:45 EDT 2005] */



More information about the commits mailing list