You've already forked FFmpeg
							
							
				mirror of
				https://github.com/FFmpeg/FFmpeg.git
				synced 2025-10-30 23:18:11 +02:00 
			
		
		
		
	lavd/x11grab: fix vertical repositioning
There is a calculation error in xcbgrab_reposition() that breaks vertical repositioning on follow_mouse. It made the bottom reposition occur when moving the mouse lower than N pixels after the capture bottom edge, instead of before. This commit fixes the calculation to match the documentation. follow_mouse: centered or number of pixels. The documentation says: When it is specified with "centered", the grabbing region follows the mouse pointer and keeps the pointer at the center of region; otherwise, the region follows only when the mouse pointer reaches within PIXELS (greater than zero) to the edge of region.
This commit is contained in:
		
				
					committed by
					
						 Carl Eugen Hoyos
						Carl Eugen Hoyos
					
				
			
			
				
	
			
			
			
						parent
						
							772c73e61f
						
					
				
				
					commit
					f4f40cbb57
				
			| @@ -127,7 +127,7 @@ static int xcbgrab_reposition(AVFormatContext *s, | ||||
|         int left   = x + f; | ||||
|         int right  = x + w - f; | ||||
|         int top    = y + f; | ||||
|         int bottom = y + h + f; | ||||
|         int bottom = y + h - f; | ||||
|         if (p_x > right) { | ||||
|             x += p_x - right; | ||||
|         } else if (p_x < left) { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user