mirror of
https://github.com/Suwayomi/Suwayomi-Server.git
synced 2026-06-30 17:34:39 -05:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user