Przeglądaj źródła

Fix copy-paste bug for IPoint/IBounds return types (#852)

Pavel Alexandrov 5 lat temu
rodzic
commit
b340796c31
2 zmienionych plików z 8 dodań i 8 usunięć
  1. 4 4
      h2d/col/IBounds.hx
  2. 4 4
      h2d/col/IPoint.hx

+ 4 - 4
h2d/col/IBounds.hx

@@ -83,8 +83,8 @@ class IBounds {
 		yMax = Math.imax(yMax, b.yMax);
 		yMax = Math.imax(yMax, b.yMax);
 	}
 	}
 
 
-	public function intersection( b : IBounds ) {
-		var i = new Bounds();
+	public function intersection( b : IBounds ) : IBounds {
+		var i = new IBounds();
 		i.xMin = Math.imax(xMin, b.xMin);
 		i.xMin = Math.imax(xMin, b.xMin);
 		i.yMin = Math.imax(yMin, b.yMin);
 		i.yMin = Math.imax(yMin, b.yMin);
 		i.xMax = Math.imin(xMax, b.xMax);
 		i.xMax = Math.imin(xMax, b.xMax);
@@ -94,8 +94,8 @@ class IBounds {
 		return i;
 		return i;
 	}
 	}
 
 
-	public function union( b : IBounds ) {
-		var i = new Bounds();
+	public function union( b : IBounds ) : IBounds {
+		var i = new IBounds();
 		i.xMin = Math.imin(xMin, b.xMin);
 		i.xMin = Math.imin(xMin, b.xMin);
 		i.yMin = Math.imin(yMin, b.yMin);
 		i.yMin = Math.imin(yMin, b.yMin);
 		i.xMax = Math.imax(xMax, b.xMax);
 		i.xMax = Math.imax(xMax, b.xMax);

+ 4 - 4
h2d/col/IPoint.hx

@@ -29,12 +29,12 @@ class IPoint {
 		return "{" + x + "," + y + "}";
 		return "{" + x + "," + y + "}";
 	}
 	}
 
 
-	public inline function sub( p : IPoint ) {
-		return new Point(x - p.x, y - p.y);
+	public inline function sub( p : IPoint ) : IPoint {
+		return new IPoint(x - p.x, y - p.y);
 	}
 	}
 
 
-	public inline function add( p : IPoint ) {
-		return new Point(x + p.x, y + p.y);
+	public inline function add( p : IPoint ) : IPoint {
+		return new IPoint(x + p.x, y + p.y);
 	}
 	}
 
 
 	public inline function equals( other : IPoint ) : Bool {
 	public inline function equals( other : IPoint ) : Bool {