Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
Kayak UI 0.11
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Microhacks
Bevy Forks
Kayak UI 0.11
Commits
d97d9a9e
Commit
d97d9a9e
authored
2 years ago
by
NiseVoid
Browse files
Options
Downloads
Patches
Plain Diff
Fix cursor position
parent
9ed167ec
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/input.rs
+1
-16
1 addition, 16 deletions
src/input.rs
with
1 addition
and
16 deletions
src/input.rs
+
1
−
16
View file @
d97d9a9e
...
@@ -5,7 +5,6 @@ use bevy::{
...
@@ -5,7 +5,6 @@ use bevy::{
ButtonState
,
ButtonState
,
},
},
prelude
::
*
,
prelude
::
*
,
window
::
PrimaryWindow
,
};
};
use
crate
::{
use
crate
::{
...
@@ -15,17 +14,6 @@ use crate::{
...
@@ -15,17 +14,6 @@ use crate::{
};
};
pub
(
crate
)
fn
process_events
(
world
:
&
mut
World
)
{
pub
(
crate
)
fn
process_events
(
world
:
&
mut
World
)
{
// TODO: Rewrite an process events per window.
let
window_size
=
if
let
Ok
(
window
)
=
world
.query_filtered
::
<&
Window
,
With
<
PrimaryWindow
>>
()
.get_single
(
world
)
{
Vec2
::
new
(
window
.width
(),
window
.height
())
}
else
{
log
::
warn!
(
"Couldn't find primary window!"
);
return
;
};
let
mut
input_events
=
Vec
::
new
();
let
mut
input_events
=
Vec
::
new
();
query_world
::
<
query_world
::
<
...
@@ -62,10 +50,7 @@ pub(crate) fn process_events(world: &mut World) {
...
@@ -62,10 +50,7 @@ pub(crate) fn process_events(world: &mut World) {
.last
()
.last
()
{
{
// Currently, we can only handle a single MouseMoved event at a time so everything but the last needs to be skipped
// Currently, we can only handle a single MouseMoved event at a time so everything but the last needs to be skipped
input_events
.push
(
InputEvent
::
MouseMoved
((
input_events
.push
(
InputEvent
::
MouseMoved
(
event
.position
.into
()));
event
.position.x
,
window_size
.y
-
event
.position.y
,
)));
}
}
for
event
in
custom_event_mouse_button
.0
.iter
(
&
mouse_button_input_events
)
{
for
event
in
custom_event_mouse_button
.0
.iter
(
&
mouse_button_input_events
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment