From 19e2c4672b9c3e379670c197884e1329ed65b33d Mon Sep 17 00:00:00 2001 From: Jack Mac Date: Fri, 15 Oct 2021 16:47:24 -0400 Subject: [PATCH] fixed tests --- imgui/src/drag_drop.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/imgui/src/drag_drop.rs b/imgui/src/drag_drop.rs index a71dcb7..5e19e5e 100644 --- a/imgui/src/drag_drop.rs +++ b/imgui/src/drag_drop.rs @@ -90,7 +90,7 @@ impl Ui { /// ui.button("Hello, I am a drag source!"); /// /// // Creates an empty DragSource with no tooltip -/// DragDropSource::new("BUTTON_DRAG").begin(ui); +/// ui.drag_drop_source_config("BUTTON_DRAG").begin(); /// } /// ``` /// @@ -160,7 +160,7 @@ impl<'ui, T: AsRef> DragDropSource<'ui, T> { /// let drag_drop_name = "Test Drag"; /// /// // drag drop SOURCE - /// if DragDropSource::new(drag_drop_name).begin(ui).is_some() { + /// if ui.drag_drop_source_config(drag_drop_name).begin().is_some() { /// // warning -- this would allocate every frame if `DragDropSource` has /// // condition `Always`, which it does by default. We're okay with that for /// // this example, but real code probably wouldn't want to allocate so much. @@ -170,7 +170,7 @@ impl<'ui, T: AsRef> DragDropSource<'ui, T> { /// ui.button("Target me!"); /// /// // drag drop TARGET - /// if let Some(target) = imgui::DragDropTarget::new(ui) { + /// if let Some(target) = ui.drag_drop_target() { /// if target /// .accept_payload_empty(drag_drop_name, DragDropFlags::empty()) /// .is_some() @@ -214,7 +214,7 @@ impl<'ui, T: AsRef> DragDropSource<'ui, T> { /// let msg_to_send = "hello there sailor"; /// /// // drag drop SOURCE - /// if let Some(tooltip) = DragDropSource::new(drag_drop_name).begin_payload(ui, msg_to_send) { + /// if let Some(tooltip) = ui.drag_drop_source_config(drag_drop_name).begin_payload(msg_to_send) { /// ui.text("Sending message!"); /// tooltip.end(); /// } @@ -222,7 +222,7 @@ impl<'ui, T: AsRef> DragDropSource<'ui, T> { /// ui.button("Target me!"); /// /// // drag drop TARGET - /// if let Some(target) = imgui::DragDropTarget::new(ui) { + /// if let Some(target) = ui.drag_drop_target() { /// if let Some(Ok(payload_data)) = target /// .accept_payload::<&'static str, _>(drag_drop_name, DragDropFlags::empty()) /// { @@ -369,7 +369,7 @@ impl<'ui> DragDropTarget<'ui> { /// Creates a new DragDropTarget, which gives methods for handling /// accepting payloads. #[doc(alias = "BeginDragDropTarget")] - #[deprecated(since = "0.9.0", note = "Use `ui.drag_drop_taget() instead")] + #[deprecated(since = "0.9.0", note = "Use `ui.drag_drop_target() instead")] pub fn new(ui: &'ui Ui) -> Option { ui.drag_drop_target() }