Add doc-test example for Modifiers::matches
This commit is contained in:
parent
7583a44e32
commit
6a80e6fc74
|
|
@ -466,6 +466,16 @@ impl Modifiers {
|
||||||
|
|
||||||
/// Check for equality but with proper handling of [`Self::command`].
|
/// Check for equality but with proper handling of [`Self::command`].
|
||||||
///
|
///
|
||||||
|
/// # Example:
|
||||||
|
/// ```
|
||||||
|
/// # use egui::Modifiers;
|
||||||
|
/// # let current_modifiers = Modifiers::default();
|
||||||
|
/// if current_modifiers.matches(Modifiers::ALT | Modifiers::SHIFT) {
|
||||||
|
/// // Alt and Shift are pressed, and nothing else
|
||||||
|
/// }
|
||||||
|
/// ```
|
||||||
|
///
|
||||||
|
/// ## Behavior:
|
||||||
/// ```
|
/// ```
|
||||||
/// # use egui::Modifiers;
|
/// # use egui::Modifiers;
|
||||||
/// assert!(Modifiers::CTRL.matches(Modifiers::CTRL));
|
/// assert!(Modifiers::CTRL.matches(Modifiers::CTRL));
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue