From 9a9484ff2146785f834994ac3c7a708fe35ec3e0 Mon Sep 17 00:00:00 2001 From: Malik Olivier Boussejra Date: Tue, 24 Apr 2018 12:17:04 +0900 Subject: [PATCH] ChannelsSplit: Rename channels_set_current to set_current Fancier API --- imgui-examples/examples/test_drawing_channels_split.rs | 6 +++--- src/window_draw_list.rs | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/imgui-examples/examples/test_drawing_channels_split.rs b/imgui-examples/examples/test_drawing_channels_split.rs index 6cccf8f..d38d8b8 100644 --- a/imgui-examples/examples/test_drawing_channels_split.rs +++ b/imgui-examples/examples/test_drawing_channels_split.rs @@ -20,10 +20,10 @@ fn main() { // Here, we draw a red line on channel 1 then a white circle on // channel 0. As a result, the red line will always appear on top of // the white circle. - draw_list.channels_split(2, |draw_list| { + draw_list.channels_split(2, |channels| { const RADIUS: f32 = 100.0; let canvas_pos = ui.get_cursor_screen_pos(); - draw_list.channels_set_current(1); + channels.set_current(1); draw_list .add_line( canvas_pos, @@ -33,7 +33,7 @@ fn main() { .thickness(5.0) .build(); - draw_list.channels_set_current(0); + channels.set_current(0); let center = (canvas_pos.0 + RADIUS, canvas_pos.1 + RADIUS); draw_list .add_circle(center, RADIUS, WHITE) diff --git a/src/window_draw_list.rs b/src/window_draw_list.rs index 6d871f6..f61ad42 100644 --- a/src/window_draw_list.rs +++ b/src/window_draw_list.rs @@ -100,10 +100,10 @@ impl<'ui> WindowDrawList<'ui> { /// # use imgui::*; /// fn custom_drawing(ui: &Ui) { /// let draw_list = ui.get_window_draw_list(); - /// draw_list.channels_split(2, |draw_list| { - /// draw_list.channels_set_current(1); + /// draw_list.channels_split(2, |channels| { + /// channels.set_current(1); /// // ... Draw channel 1 - /// draw_list.channels_set_current(0); + /// channels.set_current(0); /// // ... Draw channel 0 /// }); /// } @@ -134,7 +134,7 @@ impl<'ui> ChannelsSplit<'ui> { /// Change current channel. /// /// Panic if channel_index overflows the number of channels. - pub fn channels_set_current(&self, channel_index: u32) { + pub fn set_current(&self, channel_index: u32) { assert!( channel_index < self.channels_count, "Channel cannot be set! Provided channel index ({}) is higher than channel count ({}).",