summaryrefslogtreecommitdiff
path: root/recordmydesktop/src/rectinsert.c
diff options
context:
space:
mode:
authoriovar <iovar@f606c939-3180-4ac9-a4b8-4b8779d57d0a>2007-07-17 23:29:52 +0000
committeriovar <iovar@f606c939-3180-4ac9-a4b8-4b8779d57d0a>2007-07-17 23:29:52 +0000
commit427b2689f88f6b07b6f74fc24b9073bc7de1bc4b (patch)
tree9e3729c84a4be51bc45a412342be9385c0056441 /recordmydesktop/src/rectinsert.c
parentde076487197495a590080cbe8367295dffd1324d (diff)
get_frame.c: extra parameters pdata->brwind.rgeom.x and
pdata->brwind.rgeom.y in BlocksFromList rectinsert.c: added x_offset, y_offset arguments in BlocksFromList to fix segfaults when recording an area instead of the whole desktop. initialize_data.c: initialize dummy_p_size on all cases git-svn-id: https://recordmydesktop.svn.sourceforge.net/svnroot/recordmydesktop/trunk@391 f606c939-3180-4ac9-a4b8-4b8779d57d0a
Diffstat (limited to 'recordmydesktop/src/rectinsert.c')
-rw-r--r--recordmydesktop/src/rectinsert.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/recordmydesktop/src/rectinsert.c b/recordmydesktop/src/rectinsert.c
index b46ec1f..10d9841 100644
--- a/recordmydesktop/src/rectinsert.c
+++ b/recordmydesktop/src/rectinsert.c
@@ -512,6 +512,8 @@ void ClearList(RectArea **root){
}
void BlocksFromList(RectArea **root,
+ unsigned int x_offset,
+ unsigned int y_offset,
unsigned int blocknum_x,
unsigned int blocknum_y){
@@ -529,10 +531,10 @@ void BlocksFromList(RectArea **root,
}
while(temp!=NULL){
- column_start=temp->geom.x/Y_UNIT_WIDTH;
- column_end=(temp->geom.x+temp->geom.width)/Y_UNIT_WIDTH;
- row_start=temp->geom.y/Y_UNIT_WIDTH;
- row_end=(temp->geom.y+temp->geom.height)/Y_UNIT_WIDTH;
+ column_start=(temp->geom.x-x_offset)/Y_UNIT_WIDTH;
+ column_end=(temp->geom.x+temp->geom.width-x_offset)/Y_UNIT_WIDTH;
+ row_start=(temp->geom.y-y_offset)/Y_UNIT_WIDTH;
+ row_end=(temp->geom.y+temp->geom.height-y_offset)/Y_UNIT_WIDTH;
for(i=row_start;i<row_end+1;i++){
for(j=column_start;j<column_end+1;j++){
blockno=i*blocknum_x+j;
© All Rights Reserved