Throw a floating alert when quadrilateralise blows up
authorRichard Fairhurst <richard@systemeD.net>
Fri, 8 Apr 2011 17:41:29 +0000 (18:41 +0100)
committerRichard Fairhurst <richard@systemeD.net>
Fri, 8 Apr 2011 17:41:29 +0000 (18:41 +0100)
net/systemeD/potlatch2/tools/Quadrilateralise.as

index 3ddeb2207695e39cd528ab2f87259feba9f6f872..b050fc47d9a2e747bcfec1a33d34d842a64d46a0 100644 (file)
@@ -1,6 +1,7 @@
 package net.systemeD.potlatch2.tools {
   import net.systemeD.halcyon.connection.Way;
   import net.systemeD.halcyon.connection.Node;
+  import net.systemeD.halcyon.AttentionEvent;
   import flash.geom.Point;
   import net.systemeD.halcyon.connection.*;
 
@@ -28,7 +29,7 @@ package net.systemeD.potlatch2.tools {
         functor.step();
         var newScore:Number = functor.goodness;
         if (newScore > score) {
-          trace("Quadrilateralise blew up! " + newScore + " > " + score);
+          Connection.getConnection().dispatchEvent(new AttentionEvent(AttentionEvent.ALERT, null, "Corners too sharp to straighten"));
           return false;
            }
         score = newScore;