(node: &Value)
| 146 | } |
| 147 | |
| 148 | fn element_center(node: &Value) -> Option<(f64, f64)> { |
| 149 | let frame = node.get("frame")?; |
| 150 | let x = frame.get("x")?.as_f64()?; |
| 151 | let y = frame.get("y")?.as_f64()?; |
| 152 | let width = frame.get("width")?.as_f64()?; |
| 153 | let height = frame.get("height")?.as_f64()?; |
| 154 | (width > 0.0 && height > 0.0).then_some((x + width / 2.0, y + height / 2.0)) |
| 155 | } |
| 156 | |
| 157 | fn element_size(node: &Value) -> Option<(f64, f64)> { |
| 158 | let frame = node.get("frame")?; |
no test coverage detected