v0.6.3: significant refactoring and performance improvements to fog of war
This commit is contained in:
@@ -99,6 +99,15 @@ public class Rect {
|
||||
return result;
|
||||
}
|
||||
|
||||
public Rect union( Rect other ){
|
||||
Rect result = new Rect();
|
||||
result.left = Math.min( left, other.left );
|
||||
result.right = Math.max( right, other.right );
|
||||
result.top = Math.min( top, other.top );
|
||||
result.bottom = Math.max( bottom, other.bottom );
|
||||
return result;
|
||||
}
|
||||
|
||||
public Rect union( int x, int y ) {
|
||||
if (isEmpty()) {
|
||||
return set( x, y, x + 1, y + 1 );
|
||||
|
||||
Reference in New Issue
Block a user