]> git.sesse.net Git - vlc/blobdiff - modules/video_filter/crop.c
Make mouse-moved and mouse-clicked coordinates, remove mouse-x and -y
[vlc] / modules / video_filter / crop.c
index b3342173143b1760d9008c5ada5b55f10b9a1202..b48cd08ed2ce3ca9bd28a234889cf2c8acc5c448 100644 (file)
@@ -831,14 +831,14 @@ static int MouseEvent( vlc_object_t *p_this, char const *psz_var,
     vout_thread_t *p_vout = p_data;
     VLC_UNUSED(p_this); VLC_UNUSED(oldval);
 
+    if( !strcmp( psz_var, "mouse-button-down" ) )
+        return var_SetChecked( p_vout, psz_var, VLC_VAR_INTEGER, newval );
+
     /* Translate the mouse coordinates
      * FIXME missing lock */
-    if( !strcmp( psz_var, "mouse-x" ) )
-        newval.i_int += p_vout->p_sys->i_x;
-    else if( !strcmp( psz_var, "mouse-y" ) )
-        newval.i_int += p_vout->p_sys->i_y;
-
-    return var_Set( p_vout, psz_var, newval );
+    newval.coords.x += p_vout->p_sys->i_x;
+    newval.coords.y += p_vout->p_sys->i_y;
+    return var_SetChecked( p_vout, psz_var, VLC_VAR_COORDS, newval );
 }
 
 #ifdef BEST_AUTOCROP