Returns the drawing commands for a rectangle
(x1: f32, y1: f32, x2: f32, y2: f32)
| 98 | /// Returns the drawing commands for a rectangle |
| 99 | /// |
| 100 | pub fn draw_rect(x1: f32, y1: f32, x2: f32, y2: f32) -> Vec<Draw> { |
| 101 | use self::Draw::*; |
| 102 | use self::PathOp::*; |
| 103 | |
| 104 | vec![ |
| 105 | Path(Move(x1, y1)), |
| 106 | Path(Line(x1, y2)), |
| 107 | Path(Line(x2, y2)), |
| 108 | Path(Line(x2, y1)), |
| 109 | Path(Line(x1, y1)), |
| 110 | Path(ClosePath) |
| 111 | ] |
| 112 | } |
| 113 | |
| 114 | /// |
| 115 | /// Returns the drawing commands for a circle |