added proper rounding in VectorFloat.java

This commit is contained in:
hneemann 2018-03-19 08:55:15 +01:00
parent c845be7976
commit 083cd8db2e

View File

@ -28,12 +28,12 @@ public class VectorFloat implements VectorInterface {
@Override @Override
public int getX() { public int getX() {
return (int) x; return Math.round(x);
} }
@Override @Override
public int getY() { public int getY() {
return (int) y; return Math.round(y);
} }
@Override @Override
@ -54,7 +54,7 @@ public class VectorFloat implements VectorInterface {
/** /**
* Subtracts the given vector * Subtracts the given vector
* *
* @param sub the vector zo subtract * @param sub the vector to subtract
* @return the new vector * @return the new vector
*/ */
public VectorFloat sub(VectorInterface sub) { public VectorFloat sub(VectorInterface sub) {