-
Notifications
You must be signed in to change notification settings - Fork 33
return coordinates in MouseInput events #97
return coordinates in MouseInput events #97
Conversation
fa78c11
to
57e9758
Compare
@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)))) | ||
}, |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
57e9758
to
8708616
Compare
@paulrouget I've refactored it. |
@bors-servo r+ |
📌 Commit 8708616 has been approved by |
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 -->
☀️ Test successful - travis |
…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 -->
…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 -->
Return mouse coordinates in MouseInput event.
Due to this servo issue
This change is![Reviewable](https://camo.githubusercontent.com/23b05f5fb48215c989e92cc44cf6512512d083132bd3daf689867c8d9d386888/68747470733a2f2f72657669657761626c652e696f2f7265766965775f627574746f6e2e737667)