[vlc-devel] commit: Use mouse as capture retangle center instead of upper left corner. (Antoine Cellerier )
git version control
git at videolan.org
Mon May 26 16:06:23 CEST 2008
vlc | branch: master | Antoine Cellerier <dionoea at videolan.org> | Mon May 26 16:06:02 2008 +0200| [005db53dd87c0bea5bfc7ae72e5efafb68fc986b]
Use mouse as capture retangle center instead of upper left corner.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=005db53dd87c0bea5bfc7ae72e5efafb68fc986b
---
modules/access/screen/x11.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/modules/access/screen/x11.c b/modules/access/screen/x11.c
index a8cf374..6020285 100644
--- a/modules/access/screen/x11.c
+++ b/modules/access/screen/x11.c
@@ -123,8 +123,12 @@ block_t *screen_Capture( demux_t *p_demux )
&root, &child, &root_x, &root_y, &win_x, &win_y,
&mask ) )
{
+ root_x -= p_sys->i_width/2;
+ if( root_x < 0 ) root_x = 0;
p_sys->i_left = __MIN( (unsigned int)root_x,
p_sys->i_screen_width - p_sys->i_width );
+ root_y -= p_sys->i_height/2;
+ if( root_y < 0 ) root_y = 0;
p_sys->i_top = __MIN( (unsigned int)root_y,
p_sys->i_screen_height - p_sys->i_height );
}
More information about the vlc-devel
mailing list