[prev in list] [next in list] [prev in thread] [next in thread] 

List:       osflash-sandy
Subject:    [Sandy] [sandy commit] r894 -
From:       codesite-noreply () google ! com (codesite-noreply at google ! com)
Date:       2009-01-04 14:58:10
Message-ID: 001636163c891e5962045fa967c8 () google ! com
[Download RAW message or body]

Author: cyanescent
Date: Sun Jan  4 06:35:37 2009
New Revision: 894

Modified:
    trunk/sandy/haxe/trunk/src/sandy/extrusion/data/Polygon2D.hx

Log:
Fix to pass javascript testcase (convexHull).



Modified: trunk/sandy/haxe/trunk/src/sandy/extrusion/data/Polygon2D.hx
==============================================================================
--- trunk/sandy/haxe/trunk/src/sandy/extrusion/data/Polygon2D.hx	(original)
+++ trunk/sandy/haxe/trunk/src/sandy/extrusion/data/Polygon2D.hx	Sun Jan  4  
06:35:37 2009
@@ -260,7 +260,11 @@
  				return new Polygon2D (pointsHolder);

  			// lexicographic sort
+#if flash
  			untyped pointsHolder.sortOn (["x", "y"], Array.NUMERIC);
+#else
+			pointsHolder.sort( function(a,b) {return ( a.x>b.x || ( a.x==b.x &&  
a.y>b.y ) ) ? 1: ( a.x<b.x || ( a.x==b.x && a.y<b.y ) ) ? -1 : 0;} );
+#end

  			// compute top part of hull
  			topHull.push (0);
@@ -332,4 +336,4 @@
  			// funny thing is that convexHull() works regardless if either < or >  
is used here
  			return (new Polygon2D ([origin, p1, p2]).area () < 0);
  		}
-}
\ No newline at end of file
+}


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic