From 53828505edd9d8490e6c7e00c8b195f324cb96e2 Mon Sep 17 00:00:00 2001 From: Thom Chiovoloni Date: Mon, 1 Feb 2021 03:17:36 -0800 Subject: [PATCH] Fix compile errors with 1.80 update --- imgui/src/draw_list.rs | 2 +- imgui/src/io.rs | 5 ++--- imgui/src/style.rs | 17 +++++++++++++++++ 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/imgui/src/draw_list.rs b/imgui/src/draw_list.rs index e8069b5..b117dc7 100644 --- a/imgui/src/draw_list.rs +++ b/imgui/src/draw_list.rs @@ -592,7 +592,7 @@ impl<'ui> BezierCurve<'ui> { /// Draw the curve on the window. pub fn build(self) { unsafe { - sys::ImDrawList_AddBezierCurve( + sys::ImDrawList_AddBezierCubic( self.draw_list.draw_list, self.pos0.into(), self.cp0.into(), diff --git a/imgui/src/io.rs b/imgui/src/io.rs index 0d472e6..18a9c69 100644 --- a/imgui/src/io.rs +++ b/imgui/src/io.rs @@ -213,8 +213,7 @@ pub struct Io { pub(crate) clipboard_user_data: *mut c_void, ime_set_input_screen_pos_fn: Option, ime_window_handle: *mut c_void, - render_draw_lists_fn_unused: *mut c_void, - + // render_draw_lists_fn_unused: *mut c_void, /// Mouse position, in pixels. /// /// Set to [f32::MAX, f32::MAX] if mouse is unavailable (on another screen, etc.). @@ -438,7 +437,7 @@ fn test_io_memory_layout() { assert_field_offset!(clipboard_user_data, ClipboardUserData); assert_field_offset!(ime_set_input_screen_pos_fn, ImeSetInputScreenPosFn); assert_field_offset!(ime_window_handle, ImeWindowHandle); - assert_field_offset!(render_draw_lists_fn_unused, RenderDrawListsFnUnused); + // assert_field_offset!(render_draw_lists_fn_unused, RenderDrawListsFnUnused); assert_field_offset!(mouse_pos, MousePos); assert_field_offset!(mouse_down, MouseDown); assert_field_offset!(mouse_wheel, MouseWheel); diff --git a/imgui/src/style.rs b/imgui/src/style.rs index f7f12c8..79bcfbc 100644 --- a/imgui/src/style.rs +++ b/imgui/src/style.rs @@ -199,6 +199,13 @@ impl IndexMut for Style { #[repr(u32)] #[derive(Copy, Clone, Debug, Hash, Eq, PartialEq)] pub enum StyleColor { + // pub const ImGuiCol_TextSelectedBg: ImGuiCol_ = 47; + // pub const ImGuiCol_DragDropTarget: ImGuiCol_ = 48; + // pub const ImGuiCol_NavHighlight: ImGuiCol_ = 49; + // pub const ImGuiCol_NavWindowingHighlight: ImGuiCol_ = 50; + // pub const ImGuiCol_NavWindowingDimBg: ImGuiCol_ = 51; + // pub const ImGuiCol_ModalWindowDimBg: ImGuiCol_ = 52; + // pub const ImGuiCol_COUNT: ImGuiCol_ = 53; Text = sys::ImGuiCol_Text, TextDisabled = sys::ImGuiCol_TextDisabled, /// Background of normal windows @@ -245,6 +252,11 @@ pub enum StyleColor { PlotLinesHovered = sys::ImGuiCol_PlotLinesHovered, PlotHistogram = sys::ImGuiCol_PlotHistogram, PlotHistogramHovered = sys::ImGuiCol_PlotHistogramHovered, + TableHeaderBg = sys::ImGuiCol_TableHeaderBg, + TableBorderStrong = sys::ImGuiCol_TableBorderStrong, + TableBorderLight = sys::ImGuiCol_TableBorderLight, + TableRowBg = sys::ImGuiCol_TableRowBg, + TableRowBgAlt = sys::ImGuiCol_TableRowBgAlt, TextSelectedBg = sys::ImGuiCol_TextSelectedBg, DragDropTarget = sys::ImGuiCol_DragDropTarget, /// Gamepad/keyboard: current highlighted item @@ -302,6 +314,11 @@ impl StyleColor { StyleColor::PlotLinesHovered, StyleColor::PlotHistogram, StyleColor::PlotHistogramHovered, + StyleColor::TableHeaderBg, + StyleColor::TableBorderStrong, + StyleColor::TableBorderLight, + StyleColor::TableRowBg, + StyleColor::TableRowBgAlt, StyleColor::TextSelectedBg, StyleColor::DragDropTarget, StyleColor::NavHighlight,