diff --git a/egui-winit/src/lib.rs b/egui-winit/src/lib.rs index 9210aed7..497db28a 100644 --- a/egui-winit/src/lib.rs +++ b/egui-winit/src/lib.rs @@ -679,7 +679,7 @@ fn translate_cursor(cursor_icon: egui::CursorIcon) -> Option Option<*mut c_void> { +fn get_wayland_display(_window: &winit::window::Window) -> Option<*mut c_void> { #[cfg(any( target_os = "linux", target_os = "dragonfly", @@ -688,7 +688,7 @@ fn get_wayland_display(window: &winit::window::Window) -> Option<*mut c_void> { target_os = "openbsd" ))] { - return window.wayland_display(); + return _window.wayland_display(); } #[allow(unreachable_code)] diff --git a/egui/src/widgets/plot/mod.rs b/egui/src/widgets/plot/mod.rs index bc4d47c4..581c92f2 100644 --- a/egui/src/widgets/plot/mod.rs +++ b/egui/src/widgets/plot/mod.rs @@ -672,14 +672,14 @@ impl Plot { if axes.link_y { bounds.set_y(&linked_bounds); // Turn off auto bounds to keep it from overriding what we just set. - auto_bounds.y = false + auto_bounds.y = false; } } }; // Allow double clicking to reset to automatic bounds. if response.double_clicked_by(PointerButton::Primary) { - auto_bounds = true.into() + auto_bounds = true.into(); } // Set bounds automatically based on content. @@ -726,7 +726,7 @@ impl Plot { if allow_drag && response.dragged_by(PointerButton::Primary) { response = response.on_hover_cursor(CursorIcon::Grabbing); transform.translate_bounds(-response.drag_delta()); - auto_bounds = false.into() + auto_bounds = false.into(); } // Zooming @@ -767,9 +767,9 @@ impl Plot { }; if new_bounds.is_valid() { *transform.bounds_mut() = new_bounds; - auto_bounds = false.into() + auto_bounds = false.into(); } else { - auto_bounds = true.into() + auto_bounds = true.into(); } // reset the boxed zoom state last_click_pos_for_zoom = None; @@ -786,14 +786,14 @@ impl Plot { }; if zoom_factor != Vec2::splat(1.0) { transform.zoom(zoom_factor, hover_pos); - auto_bounds = false.into() + auto_bounds = false.into(); } } if allow_scroll { let scroll_delta = ui.input().scroll_delta; if scroll_delta != Vec2::ZERO { transform.translate_bounds(-scroll_delta); - auto_bounds = false.into() + auto_bounds = false.into(); } } } diff --git a/epaint/src/color.rs b/epaint/src/color.rs index 7a531c44..de29b6a8 100644 --- a/epaint/src/color.rs +++ b/epaint/src/color.rs @@ -186,9 +186,12 @@ impl Color32 { } } +// ---------------------------------------------------------------------------- + /// Construct a [`Color32`] from a hex RGB or RGBA string. /// -/// ```ignore +/// ``` +/// # use epaint::{hex_color, Color32}; /// assert_eq!(hex_color!("#202122"), Color32::from_rgb(0x20, 0x21, 0x22)); /// assert_eq!(hex_color!("#abcdef12"), Color32::from_rgba_unmultiplied(0xab, 0xcd, 0xef, 0x12)); /// ```