Skip to content
Snippets Groups Projects
Commit 5f7aaa7e authored by MrGVSV's avatar MrGVSV
Browse files

Formatting

parent f4eb7520
No related branches found
No related tags found
No related merge requests found
......@@ -460,8 +460,8 @@ impl KayakContext {
#[cfg(feature = "bevy_renderer")]
pub fn query_world<T: bevy::ecs::system::SystemParam, F, R>(&mut self, mut f: F) -> R
where
F: FnMut(<T::Fetch as bevy::ecs::system::SystemParamFetch<'_, '_>>::Item) -> R,
where
F: FnMut(<T::Fetch as bevy::ecs::system::SystemParamFetch<'_, '_>>::Item) -> R,
{
let mut world = self.get_global_state::<bevy::prelude::World>().unwrap();
let mut system_state = bevy::ecs::system::SystemState::<T>::new(&mut world);
......
......@@ -3,7 +3,10 @@ use crate::flo_binding::{Binding, MutableBound};
use crate::layout_cache::Rect;
use crate::render_command::RenderCommand;
use crate::widget_manager::WidgetManager;
use crate::{Event, EventType, Index, InputEvent, InputEventCategory, KayakContext, KeyCode, KeyboardEvent, KeyboardModifiers, PointerEvents, Widget};
use crate::{
Event, EventType, Index, InputEvent, InputEventCategory, KayakContext, KeyCode, KeyboardEvent,
KeyboardModifiers, PointerEvents, Widget,
};
use std::collections::{HashMap, HashSet};
type EventMap = HashMap<Index, HashSet<EventType>>;
......@@ -363,7 +366,8 @@ impl EventDispatcher {
}
if self.has_cursor.is_none() {
if let Some(widget) = widget_manager.current_widgets.get(node).unwrap() {
let widget = widget_manager.current_widgets.get(node).unwrap();
if let Some(widget) = widget {
// Check if the cursor moved onto a widget that qualifies as one that can contain it
if Self::can_contain_cursor(widget) {
self.has_cursor = Some(node);
......@@ -490,7 +494,10 @@ impl EventDispatcher {
fn can_contain_cursor(widget: &Box<dyn Widget>) -> bool {
if let Some(styles) = widget.get_styles() {
let cmds = styles.render_command.resolve();
!matches!(cmds, RenderCommand::Empty | RenderCommand::Layout | RenderCommand::Clip)
!matches!(
cmds,
RenderCommand::Empty | RenderCommand::Layout | RenderCommand::Clip
)
} else {
false
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment