Example #1
0
 void on_mouse_button_down(int x, int y, unsigned flags) 
 {
     if(flags & 1)
     {
         double xd = x;
         double yd = y;
         double r = 4.0 / m_scale.scale();
         m_scale.inverse_transform(&xd, &yd);
         m_point_idx = m_shape.hit_test(xd, yd, r);
         force_redraw();
     }
 }
Example #2
0
 void on_mouse_move(int x, int y, unsigned flags) 
 {
     if((flags & 1) == 0)
     {
         on_mouse_button_up(x, y, flags);
     }
     else
     {
         if(m_point_idx >= 0)
         {
             double xd = x;
             double yd = y;
             m_scale.inverse_transform(&xd, &yd);
             m_shape.modify_vertex(m_point_idx, xd, yd);
             force_redraw();
         }
     }
 }