(double[] vals)
| 32 | } |
| 33 | |
| 34 | public void set(double[] vals) { |
| 35 | if (vals != null) { |
| 36 | x = vals.length > 0 ? (double) vals[0] : 0; |
| 37 | y = vals.length > 1 ? (double) vals[1] : 0; |
| 38 | width = vals.length > 2 ? (double) vals[2] : 0; |
| 39 | height = vals.length > 3 ? (double) vals[3] : 0; |
| 40 | } else { |
| 41 | x = 0; |
| 42 | y = 0; |
| 43 | width = 0; |
| 44 | height = 0; |
| 45 | } |
| 46 | } |
| 47 | |
| 48 | public Rect2d clone() { |
| 49 | return new Rect2d(x, y, width, height); |