fn interact_circle(&mut self, x: i32 , y: i32, color: Color, window: &mut Window) -> Option<(i32,f32)>{
    
        //gets events from orbclient and render helping lines directly into orbclient window 
        let mut orbclient = window.inner.borrow_mut();
        //let mut orbclient = window.inner().borrow_mut();
        let mut w = false;
        let mut dx = 0_i32;
        let mut dy = 0_i32;
        let mut r = 0_i32;
        let mut r_old = 0_i32;
        'events: loop{
            for event in orbclient.events() { 
                match event.to_option() {
                    EventOption::Key(key_event) => {println!("Event:{:?}",key_event); break 'events},
                    EventOption::Quit(_quit_event) => break 'events,
                    EventOption::Scroll(scroll_event) => println!("Scroll not implemented yet..{:?}",scroll_event),
                    EventOption::Mouse(evt) => {
                                                if evt.y < CANVASOFFSET{
                                                    break 'events
                                                };
                                                if w {
                                                    orbclient.circle_marquee(x, y+CANVASOFFSET, r_old, Color::rgba(100, 100, 100, 0)); 
                                                }
                                                w=true;
                                                r = dx.pow(2)+dy.pow(2);
                                                r = ((r as f64).sqrt()) as i32;
                                                r_old = r;
                                                
                                                orbclient.circle_marquee(x, y+CANVASOFFSET, r, Color::rgba(100, 100, 100, 0)); 
                                                orbclient.sync();

                                                dx=evt.x-x;
                                                dy=evt.y-y-CANVASOFFSET;
                                                },
                    EventOption::Button(btn) => {
                                                if btn.left {
                                                    
                                                    let angle = (dx as f32/r as f32).asin();
                                                    
                                                    return Some((r,angle))
                                                    //break 'events 
                                                }
                                                if btn.right{
                                                    break 'events
                                                    }
                                                },
                    event_option => if cfg!(feature = "debug"){println!("Option: {:?}", event_option)}
                                    else{}
                }
          }
        }
        None
    }
/// by drawing an interactive circle in preview window , return a tuple with radius and cursor angular position  
by drawing an interactive circle in preview window , return a tuple with radius and cursor angular position
by drawing an interactive circle in preview window return a tuple with radius and cursor angular position
fn interact_circle(&mut self, x: i32 , y: i32, color: Color, window: &mut Window) -> Option<(i32,f32)>{
        //gets events from orbclient and render helping lines directly into orbclient window 
        let mut orbclient = window.inner.borrow_mut();
        //let mut orbclient = window.inner().borrow_mut();
        let mut w = false;
        let mut dx = 0_i32;
        let mut dy = 0_i32;
        let mut r = 0_i32;
        let mut r_old = 0_i32;
        'events: loop{
            for event in orbclient.events() { 
                match event.to_option() {
                    EventOption::Key(key_event) => {println!("Event:{:?}",key_event); break 'events},
                    EventOption::Quit(_quit_event) => break 'events,
                    EventOption::Scroll(scroll_event) => println!("Scroll not implemented yet..{:?}",scroll_event),
                    EventOption::Mouse(evt) => {
                                                if evt.y < CANVASOFFSET{
                                                    break 'events
                                                };
                                                if w {
                                                    orbclient.circle_marquee(x, y+CANVASOFFSET, r_old, Color::rgba(100, 100, 100, 0)); 
                                                }
                                                w=true;
                                                r = dx.pow(2)+dy.pow(2);
                                                r = ((r as f64).sqrt()) as i32;
                                                r_old = r;
                                                orbclient.circle_marquee(x, y+CANVASOFFSET, r, Color::rgba(100, 100, 100, 0)); 
                                                orbclient.sync();
                                                dx=evt.x-x;
                                                dy=evt.y-y-CANVASOFFSET;
                                                },
                    EventOption::Button(btn) => {
                                                if btn.left {
                                                    let angle = (dx as f32/r as f32).asin();
                                                    return Some((r,angle))
                                                    //break 'events 
                                                }
                                                if btn.right{
                                                    break 'events
                                                    }
                                                },
                    event_option => if cfg!(feature = "debug"){println!("Option: {:?}", event_option)}
                                    else{}
                }
          }
        }
        None
    }
fn interact_circle ( & mut self , x : i32 , y : i32 , color : Color , window : & mut Window ) -> Option < ( i32 , f32 ) > { //gets events from orbclient and render helping lines directly into orbclient window  let mut orbclient = window . inner . borrow_mut ( ) ; //let mut orbclient = window.inner().borrow_mut(); let mut w = false ; let mut dx = 0_i32 ; let mut dy = 0_i32 ; let mut r = 0_i32 ; let mut r_old = 0_i32 ; ' events : loop { for event in orbclient . events ( ) { match event . to_option ( ) { EventOption :: Key ( key_event ) => { println ! ( " " key_event ) ; break ' events } , EventOption :: Quit ( _quit_event ) => break ' events , EventOption :: Scroll ( scroll_event ) => println ! ( " " scroll_event ) , EventOption :: Mouse ( evt ) => { if evt . y < CANVASOFFSET { break ' events } ; if w { orbclient . circle_marquee ( x , y + CANVASOFFSET , r_old , Color :: rgba ( 100 , 100 , 100 , 0 ) ) ; } w = true ; r = dx . pow ( 2 ) + dy . pow ( 2 ) ; r = ( ( r as f64 ) . sqrt ( ) ) as i32 ; r_old = r ; orbclient . circle_marquee ( x , y + CANVASOFFSET , r , Color :: rgba ( 100 , 100 , 100 , 0 ) ) ; orbclient . sync ( ) ; dx = evt . x - x ; dy = evt . y - y - CANVASOFFSET ; } , EventOption :: Button ( btn ) => { if btn . left { let angle = ( dx as f32 / r as f32 ) . asin ( ) ; return Some ( ( r , angle ) ) //break 'events  } if btn . right { break ' events } } , event_option => if cfg ! ( feature " " ) { println ! ( " " event_option ) } else { } } } } None }
by drawing an interactive circle in preview window , return a tuple with radius and cursor angular position
by drawing an interactive circle in preview window return a tuple with radius and cursor angular position
&mut self
x
i32
y
i32
color
Color
window
&mut Window
&mut self
x
i32
y
i32
color
Color
window
&mut Window