Browse Source

fixed indexOutOfBoundException

Alexander Hendrich 11 years ago
parent
commit
ebd1c258b3
2 changed files with 2 additions and 2 deletions
  1. 1 1
      bbiwarg/Detectors/Touch/TouchDetector.cs
  2. 1 1
      bbiwarg/MainBBWIWARG.cs

+ 1 - 1
bbiwarg/Detectors/Touch/TouchDetector.cs

@@ -33,7 +33,7 @@ namespace bbiwarg.Detectors.Touch
                 {
                     PointF direction = finger.getDirection();
                     float directionFactor = -10;
-                    PointF tep = new PointF(tipPoint.getX() + directionFactor*direction.X, tipPoint.getY() + directionFactor*direction.Y);
+                    PointF tep = new PointF(Math.Max(tipPoint.getX() + directionFactor*direction.X, 0), Math.Min(tipPoint.getY() + directionFactor*direction.Y, 0));
                     
 
                     touchImage.setTouchAt((int)tep.X, (int)tep.Y, TouchImageState.touchDetected);

+ 1 - 1
bbiwarg/MainBBWIWARG.cs

@@ -12,7 +12,7 @@ namespace bbiwarg
     {
         static void Main(string[] args)
         {
-            IInputProvider inputProvider = new IisuInputProvider("..\\..\\videos\\touch\\4.skv");
+            IInputProvider inputProvider = new IisuInputProvider("..\\..\\videos\\14.skv");
             VideoHandle videoHandle = new VideoHandle(inputProvider);
             videoHandle.start();