fix: make IntVector2 not return references
This commit is contained in:
parent
27adfd1b6f
commit
e10fbb15eb
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user