Fix issues caused by 1.77 upgrade

This commit is contained in:
Joonas Javanainen 2020-07-08 00:04:47 +03:00
parent 3558a9138f
commit d3fea52613
No known key found for this signature in database
GPG Key ID: D39CCA5CB19B9179
3 changed files with 14 additions and 2 deletions

View File

@ -306,6 +306,7 @@ pub struct Io {
keys_down_duration_prev: [f32; 512],
nav_inputs_down_duration: [f32; NavInput::COUNT + NavInput::INTERNAL_COUNT],
nav_inputs_down_duration_prev: [f32; NavInput::COUNT + NavInput::INTERNAL_COUNT],
pen_pressure: f32,
input_queue_surrogate: sys::ImWchar16,
input_queue_characters: ImVector<sys::ImWchar>,
}
@ -471,6 +472,7 @@ fn test_io_memory_layout() {
assert_field_offset!(keys_down_duration_prev, KeysDownDurationPrev);
assert_field_offset!(nav_inputs_down_duration, NavInputsDownDuration);
assert_field_offset!(nav_inputs_down_duration_prev, NavInputsDownDurationPrev);
assert_field_offset!(pen_pressure, PenPressure);
assert_field_offset!(input_queue_surrogate, InputQueueSurrogate);
assert_field_offset!(input_queue_characters, InputQueueCharacters);
}

View File

@ -84,7 +84,7 @@ pub fn dear_imgui_version() -> &'static str {
#[test]
fn test_version() {
assert_eq!(dear_imgui_version(), "1.76");
assert_eq!(dear_imgui_version(), "1.77");
}
impl Context {
@ -403,7 +403,7 @@ impl<'ui> Ui<'ui> {
// Widgets: Popups
impl<'ui> Ui<'ui> {
pub fn open_popup<'p>(&self, str_id: &'p ImStr) {
unsafe { sys::igOpenPopup(str_id.as_ptr()) };
unsafe { sys::igOpenPopup(str_id.as_ptr(), 0) };
}
pub fn popup<'p, F>(&self, str_id: &'p ImStr, f: F)
where

View File

@ -15,6 +15,7 @@ pub struct Style {
/// Rounding radius of window corners.
///
/// Set to 0.0 to have rectangular windows.
/// Large values tend to lead to a variety of artifacts and are not recommended.
pub window_rounding: f32,
/// Thickness of border around windows.
///
@ -89,6 +90,11 @@ pub struct Style {
pub tab_rounding: f32,
/// Thickness of border around tabs
pub tab_border_size: f32,
/// Minimum width for close button to appear on an unselected tab when hovered.
///
/// `= 0.0`: always show when hovering
/// `= f32::MAX`: never show close button unless selected
pub tab_min_width_for_unselected_close_button: f32,
/// Side of the color buttonton pubin color editor widgets (left/right).
pub color_button_position: Direction,
/// Alignment of button text when button is larger than text.
@ -442,6 +448,10 @@ fn test_style_memory_layout() {
assert_field_offset!(grab_rounding, GrabRounding);
assert_field_offset!(tab_rounding, TabRounding);
assert_field_offset!(tab_border_size, TabBorderSize);
assert_field_offset!(
tab_min_width_for_unselected_close_button,
TabMinWidthForUnselectedCloseButton
);
assert_field_offset!(color_button_position, ColorButtonPosition);
assert_field_offset!(button_text_align, ButtonTextAlign);
assert_field_offset!(selectable_text_align, SelectableTextAlign);