diff --git a/src/window_draw_list.rs b/src/window_draw_list.rs index c2216a3..53ebb88 100644 --- a/src/window_draw_list.rs +++ b/src/window_draw_list.rs @@ -137,6 +137,40 @@ macro_rules! impl_draw_list_methods { { Rect::new(self, p1, p2, c) } + + /// Draw a rectangle whose upper-left corner is at point `p1` + /// and lower-right corner is at point `p2`. + /// The remains parameters are the respective color of the corners + /// in the counter-clockwise starting from the upper-left corner + /// first. + pub fn add_rect_filled_multicolor( + &self, + p1: P1, + p2: P2, + col_upr_left: C1, + col_upr_right: C2, + col_bot_right: C3, + col_bot_left: C4, + ) where + P1: Into, + P2: Into, + C1: Into, + C2: Into, + C3: Into, + C4: Into, + { + unsafe { + sys::ImDrawList_AddRectFilledMultiColor( + self.draw_list(), + p1.into(), + p2.into(), + col_upr_left.into().into(), + col_upr_right.into().into(), + col_bot_right.into().into(), + col_bot_left.into().into(), + ); + } + } } }; }