fix: make IntVector2 not return references

This commit is contained in:
punchready 2021-06-04 05:13:37 +02:00
parent 27adfd1b6f
commit e10fbb15eb
1 changed files with 3 additions and 9 deletions

View File

@ -79,9 +79,7 @@ public class IntVector2 implements Serializable {
}
public IntVector2 sub(int x, int y) {
this.x -= x;
this.y -= y;
return this;
return new IntVector2(this.x - x, this.y - y);
}
public IntVector2 sub(IntVector2 v) {
@ -89,9 +87,7 @@ public class IntVector2 implements Serializable {
}
public IntVector2 add(int x, int y) {
this.x += x;
this.y += y;
return this;
return new IntVector2(this.x + x, this.y + y);
}
public IntVector2 add(IntVector2 v) {
@ -111,9 +107,7 @@ public class IntVector2 implements Serializable {
}
public IntVector2 scale(float x, float y) {
this.x *= x;
this.y *= y;
return this;
return new IntVector2((int)(this.x * x), (int)(this.y * y));
}
public IntVector2 scale(float scalar) {