@@ -57,15 +57,15 @@ public float getArea() {
5757 }
5858
5959 public float verticalOverlap (Rectangle other ) {
60- return ( float ) Math .max (0 , Math .min (this .getBottom (), other .getBottom ()) - Math .max (this .getTop (), other .getTop ()));
60+ return Math .max (0 , Math .min (this .getBottom (), other .getBottom ()) - Math .max (this .getTop (), other .getTop ()));
6161 }
6262
6363 public boolean verticallyOverlaps (Rectangle other ) {
6464 return verticalOverlap (other ) > 0 ;
6565 }
6666
6767 public float horizontalOverlap (Rectangle other ) {
68- return ( float ) Math .max (0 , Math .min (this .getRight (), other .getRight ()) - Math .max (this .getLeft (), other .getLeft ()));
68+ return Math .max (0 , Math .min (this .getRight (), other .getRight ()) - Math .max (this .getLeft (), other .getLeft ()));
6969 }
7070
7171 public boolean horizontallyOverlaps (Rectangle other ) {
@@ -74,19 +74,19 @@ public boolean horizontallyOverlaps(Rectangle other) {
7474
7575 public float verticalOverlapRatio (Rectangle other ) {
7676 float rv = 0 ,
77- delta = ( float ) Math .min (this .getBottom () - this .getTop (), other .getBottom () - other .getTop ());
77+ delta = Math .min (this .getBottom () - this .getTop (), other .getBottom () - other .getTop ());
7878
7979 if (other .getTop () <= this .getTop () && this .getTop () <= other .getBottom () && other .getBottom () <= this .getBottom ()) {
80- rv = (float ) (( other .getBottom () - this .getTop ()) / delta ) ;
80+ rv = (other .getBottom () - this .getTop ()) / delta ;
8181 }
8282 else if (this .getTop () <= other .getTop () && other .getTop () <= this .getBottom () && this .getBottom () <= other .getBottom ()) {
83- rv = (float ) (( this .getBottom () - other .getTop ()) / delta ) ;
83+ rv = (this .getBottom () - other .getTop ()) / delta ;
8484 }
8585 else if (this .getTop () <= other .getTop () && other .getTop () <= other .getBottom () && other .getBottom () <= this .getBottom ()) {
86- rv = (float ) (( other .getBottom () - other .getTop ()) / delta ) ;
86+ rv = (other .getBottom () - other .getTop ()) / delta ;
8787 }
8888 else if (other .getTop () <= this .getTop () && this .getTop () <= this .getBottom () && this .getBottom () <= other .getBottom ()) {
89- rv = (float ) (( this .getBottom () - this .getTop ()) / delta ) ;
89+ rv = (this .getBottom () - this .getTop ()) / delta ;
9090 }
9191
9292 return rv ;
@@ -143,10 +143,10 @@ public void setBottom(float bottom) {
143143
144144 public Point2D [] getPoints () {
145145 return new Point2D [] {
146- new Point2D .Float (( float ) this .getLeft (), ( float ) this .getTop ()),
147- new Point2D .Float (( float ) this .getRight (), ( float ) this .getTop ()),
148- new Point2D .Float (( float ) this .getRight (), ( float ) this .getBottom ()),
149- new Point2D .Float (( float ) this .getLeft (), ( float ) this .getBottom ())
146+ new Point2D .Float (this .getLeft (), this .getTop ()),
147+ new Point2D .Float (this .getRight (), this .getTop ()),
148+ new Point2D .Float (this .getRight (), this .getBottom ()),
149+ new Point2D .Float (this .getLeft (), this .getBottom ())
150150 };
151151 }
152152
0 commit comments