diff options
author | Vito Caputo <vcaputo@pengaru.com> | 2020-06-23 17:47:21 -0700 |
---|---|---|
committer | Vito Caputo <vcaputo@pengaru.com> | 2020-07-11 13:36:41 -0700 |
commit | 6fa40224ae7f78092537f30d034b2cdd247237b1 (patch) | |
tree | c136c205a01cec87e91e348d590466f021a577a4 /recordmydesktop | |
parent | d1d6716ad3cd9eb50641485fa9ebd46991805574 (diff) |
get_frame: pass rect to rmdMoveCaptureArea
Just simplifying this function to not need brwin-> everywhere while
cleaning up the formatting
Diffstat (limited to 'recordmydesktop')
-rw-r--r-- | recordmydesktop/src/rmd_get_frame.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/recordmydesktop/src/rmd_get_frame.c b/recordmydesktop/src/rmd_get_frame.c index 4d12a6e..1666193 100644 --- a/recordmydesktop/src/rmd_get_frame.c +++ b/recordmydesktop/src/rmd_get_frame.c @@ -222,19 +222,19 @@ static void rmdBRWinCpy(BRWindow *target, BRWindow *source) { //recenters the capture area to the mouse //without exiting the display bounding box -static void rmdMoveCaptureArea( BRWindow *brwin, +static void rmdMoveCaptureArea( XRectangle *rect, int cursor_x, int cursor_y, int width, int height) { - int t_x=0,t_y=0; - - t_x=cursor_x-brwin->rrect.width/2; - t_x=(t_x>>1)<<1; - brwin->rrect.x=(t_x<0)?0:((t_x+brwin->rrect.width>width)? width-brwin->rrect.width:t_x); - t_y=cursor_y-brwin->rrect.height/2; - t_y=(t_y>>1)<<1; - brwin->rrect.y=(t_y<0)?0:((t_y+brwin->rrect.height>height)? height-brwin->rrect.height:t_y); + int t_x = 0, t_y = 0; + + t_x = cursor_x - rect->width / 2; + t_x = (t_x >> 1) << 1; + rect->x = (t_x < 0) ? 0 : ((t_x + rect->width > width) ? width - rect->width : t_x); + t_y = cursor_y - rect->height / 2; + t_y = (t_y >> 1) << 1; + rect->y = (t_y < 0 ) ? 0 : ((t_y + rect->height > height) ? height - rect->height : t_y); } /** @@ -444,7 +444,7 @@ void *rmdGetFrame(ProgData *pdata) { } } if (pdata->args.follow_mouse) { - rmdMoveCaptureArea( &pdata->brwin, + rmdMoveCaptureArea( &pdata->brwin.rrect, mouse_pos_abs.x + pdata->args.xfixes_cursor ? xcim->xhot : 0, mouse_pos_abs.y + pdata->args.xfixes_cursor ? xcim->yhot : 0, pdata->specs.width, |