pub fn draw_rect(x: i32, y: i32, w: i32, h: i32)Expand description
Draws a rectangle
Examples found in repository?
examples/table.rs (line 74)
63fn draw_data(txt: &str, x: i32, y: i32, w: i32, h: i32, selected: bool) {
64 draw::push_clip(x, y, w, h);
65 if selected {
66 draw::set_draw_color(enums::Color::from_u32(0x00D3_D3D3));
67 } else {
68 draw::set_draw_color(enums::Color::White);
69 }
70 draw::draw_rectf(x, y, w, h);
71 draw::set_draw_color(enums::Color::Gray0);
72 draw::set_font(enums::Font::Helvetica, 14);
73 draw::draw_text_boxed(txt, x, y, w, h, enums::Align::Center);
74 draw::draw_rect(x, y, w, h);
75 draw::pop_clip();
76}More examples
examples/spreadsheet.rs (line 140)
129 fn draw_data(txt: &str, x: i32, y: i32, w: i32, h: i32, selected: bool) {
130 draw::push_clip(x, y, w, h);
131 if selected {
132 draw::set_draw_color(enums::Color::from_u32(0x00D3_D3D3));
133 } else {
134 draw::set_draw_color(enums::Color::White);
135 }
136 draw::draw_rectf(x, y, w, h);
137 draw::set_draw_color(enums::Color::Gray0);
138 draw::set_font(enums::Font::Helvetica, 14);
139 draw::draw_text_boxed(txt, x, y, w, h, enums::Align::Center);
140 draw::draw_rect(x, y, w, h);
141 draw::pop_clip();
142 }