From 028ebf538f51b95efaeb2efd211d8a7e71b491da Mon Sep 17 00:00:00 2001 From: dbr Date: Wed, 10 Feb 2021 17:49:14 +1100 Subject: [PATCH] Make DrawListMut::add_image doc example more concise Longer example code in 'imgui-examples/examples/custom_textures.rs' shows more detailed usage --- imgui/src/draw_list.rs | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/imgui/src/draw_list.rs b/imgui/src/draw_list.rs index 8626fcb..b3a1637 100644 --- a/imgui/src/draw_list.rs +++ b/imgui/src/draw_list.rs @@ -262,23 +262,13 @@ impl<'ui> DrawListMut<'ui> { /// ``` /// # use imgui::*; /// fn custom_button(ui: &Ui, img_id: TextureId) { - /// // Tint image red - /// - /// // Invisible button is good widget to customise with custom image + /// // Invisible button is good widget to customise with image /// ui.invisible_button(im_str!("custom_button"), [100.0, 20.0]); /// - /// // Red tint when button is hovered, no tint otherwise - /// let overlay_color = if ui.is_item_hovered() { - /// [1.0, 0.6, 0.6, 1.0] - /// } else { - /// [1.0, 1.0, 1.0, 1.0] - /// }; - /// /// // Get draw list and draw image over invisible button /// let draw_list = ui.get_window_draw_list(); /// draw_list /// .add_image(img_id, ui.item_rect_min(), ui.item_rect_max()) - /// .col(overlay_color) /// .build(); /// } /// ```