@@ -3,14 +3,15 @@ use std::convert::TryInto;
3
3
use std:: time:: { Instant } ;
4
4
use num:: Complex ;
5
5
6
- #[ cfg( not( target_os = "emscripten" ) ) ]
6
+ // #[cfg(not(target_os = "emscripten"))]
7
7
use rayon:: prelude:: * ;
8
8
9
9
use sdl2;
10
10
use sdl2:: event:: Event ;
11
11
use sdl2:: event:: WindowEvent ;
12
12
use sdl2:: keyboard:: Keycode ;
13
13
use sdl2:: mouse:: MouseButton ;
14
+ use sdl2:: mouse:: MouseState ;
14
15
use sdl2:: pixels:: { Color , PixelFormatEnum } ;
15
16
use sdl2:: rect:: Point ;
16
17
use sdl2:: rect:: Rect ;
@@ -299,7 +300,9 @@ fn main() -> Result<(), String> {
299
300
}
300
301
} ,
301
302
Event :: MouseMotion { x, y, which, .. } if which != SDL_TOUCH_MOUSEID => {
302
- if pump. mouse_state ( ) . is_mouse_button_pressed ( MouseButton :: Left ) {
303
+ //if pump.mouse_state().is_mouse_button_pressed(MouseButton::Left) {
304
+ //if MouseState::new(pump).left() {
305
+ if pump. mouse_state ( ) . left ( ) {
303
306
//panning
304
307
//TODO: Problem with emscripten thinking that left mouse button is pressed after return from full screen mode
305
308
println ! ( "left pressed..." ) ;
@@ -517,10 +520,10 @@ fn update_bg(bg_texture: &mut sdl2::render::Texture, view:&ComplexBBox, iter:u32
517
520
518
521
//change to .into_par_iter() for parallelism
519
522
//emscripten target don't yet support multi-threading
520
- #[ cfg( not( target_os = "emscripten" ) ) ]
523
+ // #[cfg(not(target_os = "emscripten"))]
521
524
let row_iter = rows. into_par_iter ( ) ;
522
- #[ cfg( target_os = "emscripten" ) ]
523
- let row_iter = rows. into_iter ( ) ;
525
+ // #[cfg(target_os = "emscripten")]
526
+ // let row_iter = rows.into_iter();
524
527
row_iter. for_each ( |( y, buffer) | {
525
528
for x in 0 .. w {
526
529
let c = view. screen_to_complex ( x. try_into ( ) . unwrap ( ) , y. try_into ( ) . unwrap ( ) ,
0 commit comments