File tree Expand file tree Collapse file tree 1 file changed +13
-13
lines changed Expand file tree Collapse file tree 1 file changed +13
-13
lines changed Original file line number Diff line number Diff line change @@ -60,22 +60,22 @@ pub fn fs(constants: &ShaderConstants, mut frag_coord: Vec2) -> Vec4 {
60
60
0.0 ,
61
61
) ;
62
62
let time = constants. time ;
63
- let mouse = vec4 (
63
+ let mut mouse = vec4 (
64
64
constants. drag_end_x / COLS as f32 ,
65
65
constants. drag_end_y / ROWS as f32 ,
66
- constants. drag_start_x / COLS as f32
67
- * if constants. mouse_left_pressed {
68
- 1.0
69
- } else {
70
- -1.0
71
- } ,
72
- constants. drag_start_y / ROWS as f32
73
- * if constants. mouse_left_clicked {
74
- 1.0
75
- } else {
76
- -1.0
77
- } ,
66
+ constants. drag_start_x / COLS as f32 ,
67
+ constants. drag_start_y / ROWS as f32 ,
78
68
) ;
69
+ if mouse != Vec4 :: zero ( ) {
70
+ mouse. y = resolution. y - mouse. y ;
71
+ mouse. w = resolution. y - mouse. w ;
72
+ }
73
+ if !constants. mouse_left_pressed {
74
+ mouse. z *= -1.0 ;
75
+ }
76
+ if !constants. mouse_left_clicked {
77
+ mouse. w *= -1.0 ;
78
+ }
79
79
80
80
let col = ( frag_coord. x / resolution. x ) as usize ;
81
81
let row = ( frag_coord. y / resolution. y ) as usize ;
You can’t perform that action at this time.
0 commit comments