Introduce Rect.set (#1900)

* Introduce `Rect.set`

As used by Young Jump+

Also fixes the `Rect(Rect)` constructor to use the correct values

* Missing line
This commit is contained in:
Constantin Piber
2026-02-14 17:36:28 +01:00
committed by GitHub
parent a0fb30a3ad
commit 2b19bc850d

View File

@@ -37,13 +37,27 @@ public final class Rect {
this.right = 0;
this.bottom = 0;
} else {
this.left = left;
this.top = top;
this.right = right;
this.bottom = bottom;
this.left = r.left;
this.top = r.top;
this.right = r.right;
this.bottom = r.bottom;
}
}
public void set(int left, int top, int right, int bottom) {
this.left = left;
this.top = top;
this.right = right;
this.bottom = bottom;
}
public void set(Rect r) {
this.left = r.left;
this.top = r.top;
this.right = r.right;
this.bottom = r.bottom;
}
public final int getWidth() {
return right - left;
}