Implement Cloneable for all primitive wrappers

This commit is contained in:
SpaiR committed 2020-06-06 16:40:08 +03:00
1 parent 1e52d6ef82
commit 71e7265858
9 files changed
+100 -9

No files matched your search

+11 -1
View File
@@ -5,13 +5,18 @@ import java.util.Objects;
/**
* 2D vector (often used to store positions or sizes)
*/
public final class ImVec2 {
public final class ImVec2 implements Cloneable {
public float x;
public float y;
public ImVec2() {
}
public ImVec2(final ImVec2 imVec2) {
this.x = imVec2.x;
this.y = imVec2.y;
}
public ImVec2(final float x, final float y) {
this.x = x;
this.y = y;
@@ -41,4 +46,9 @@ public final class ImVec2 {
public int hashCode() {
return Objects.hash(x, y);
}
@Override
public ImVec2 clone() {
return new ImVec2(this);
}
}