MCPcopy Create free account
hub / github.com/Logicalshift/flo_draw / draw_rect

Function draw_rect

canvas/src/primitives.rs:100–112  ·  view source on GitHub ↗

Returns the drawing commands for a rectangle

(x1: f32, y1: f32, x2: f32, y2: f32)

Source from the content-addressed store, hash-verified

98/// Returns the drawing commands for a rectangle
99///
100pub 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

Callers 1

rectMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected