We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0a966f6 commit ddc5c5aCopy full SHA for ddc5c5a
widgets/src/switch.rs
@@ -25,8 +25,7 @@ struct UiButton {
25
26
impl UiButton {
27
fn contains(&self, mouse_position: Coord) -> bool {
28
- self.rect
29
- .contains_point((mouse_position.x, mouse_position.y))
+ self.rect.contains_point(mouse_position)
30
}
31
32
fn render(
@@ -38,10 +37,7 @@ impl UiButton {
38
37
let background = match background {
39
Some(background) => background,
40
None => {
41
- let x = if self
42
- .rect
43
44
- {
+ let x = if self.rect.contains_point(mouse_position) {
45
128
46
} else {
47
64
0 commit comments