Skip to content
This repository has been archived by the owner on Jul 10, 2023. It is now read-only.

return coordinates in MouseInput events #97

Merged
merged 2 commits into from
Jun 16, 2016

Conversation

mrmiywj
Copy link

@mrmiywj mrmiywj commented Jun 11, 2016

Return mouse coordinates in MouseInput event.
Due to this servo issue


This change is Reviewable

@mrmiywj
Copy link
Author

mrmiywj commented Jun 13, 2016

@paulrouget -reply

Some(MouseInput(Released, MouseButton::Right,
Some(((scale_factor * window_point.x as f32) as i32,
(scale_factor * window_point.y as f32) as i32))))
},

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any idea how to avoid repeating this code block?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, actually I want to write this code block into a function, but I'm not sure what struct it should be implemented in.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could just make it a private function inside this module, or even inside this method.

@mrmiywj mrmiywj force-pushed the return-coordinates-in-MouseInput branch from 57e9758 to 8708616 Compare June 15, 2016 12:20
@mrmiywj
Copy link
Author

mrmiywj commented Jun 15, 2016

@paulrouget I've refactored it.

@nox
Copy link

nox commented Jun 16, 2016

@bors-servo r+

@bors-servo
Copy link

📌 Commit 8708616 has been approved by nox

bors-servo pushed a commit that referenced this pull request Jun 16, 2016
return coordinates in MouseInput events

Return mouse coordinates in MouseInput event.
Due to this [servo issue](servo/servo#11130)

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/glutin/97)
<!-- Reviewable:end -->
@bors-servo
Copy link

⌛ Testing commit 8708616 with merge 51ec6bb...

@bors-servo
Copy link

☀️ Test successful - travis

@bors-servo bors-servo merged commit 8708616 into servo:servo Jun 16, 2016
bors-servo pushed a commit that referenced this pull request Jun 25, 2016
…aulroget

fix return coordinates in MouseInput

It is a fix of #97
When working on [servo/#11794](servo/servo#11794). I found the previous PR #97 is wrong. This PR is a fix of that and is right when testing [servo/#11794](servo/servo#11794).
Actually, we should return the mouse movement position instead of actual coordination. So the previous PR's return value is wrong.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/glutin/99)
<!-- Reviewable:end -->
bors-servo pushed a commit that referenced this pull request Jan 22, 2017
…pcwalton

return coordinates in MouseWheel events

Glutin side of servo/servo#14808 to fix servo/servo#14290, it's a follow up from #97

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/glutin/109)
<!-- Reviewable:end -->
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants