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)
63 64 65 66 67 68 69 70 71 72 73 74 75 76
fn draw_data(txt: &str, x: i32, y: i32, w: i32, h: i32, selected: bool) {
draw::push_clip(x, y, w, h);
if selected {
draw::set_draw_color(enums::Color::from_u32(0x00D3_D3D3));
} else {
draw::set_draw_color(enums::Color::White);
}
draw::draw_rectf(x, y, w, h);
draw::set_draw_color(enums::Color::Gray0);
draw::set_font(enums::Font::Helvetica, 14);
draw::draw_text2(txt, x, y, w, h, enums::Align::Center);
draw::draw_rect(x, y, w, h);
draw::pop_clip();
}
More examples
examples/spreadsheet.rs (line 140)
129 130 131 132 133 134 135 136 137 138 139 140 141 142
fn draw_data(txt: &str, x: i32, y: i32, w: i32, h: i32, selected: bool) {
draw::push_clip(x, y, w, h);
if selected {
draw::set_draw_color(enums::Color::from_u32(0x00D3_D3D3));
} else {
draw::set_draw_color(enums::Color::White);
}
draw::draw_rectf(x, y, w, h);
draw::set_draw_color(enums::Color::Gray0);
draw::set_font(enums::Font::Helvetica, 14);
draw::draw_text2(txt, x, y, w, h, enums::Align::Center);
draw::draw_rect(x, y, w, h);
draw::pop_clip();
}