summaryrefslogtreecommitdiff
path: root/recordmydesktop/src/rectinsert.c
diff options
context:
space:
mode:
authoriovar <iovar@f606c939-3180-4ac9-a4b8-4b8779d57d0a>2008-09-10 17:53:21 +0000
committeriovar <iovar@f606c939-3180-4ac9-a4b8-4b8779d57d0a>2008-09-10 17:53:21 +0000
commitd7618c283b8ea219012e44ba377bed6a3a836093 (patch)
tree99b3311142fb3a1eb3c88c7d8e27c9194eaa9216 /recordmydesktop/src/rectinsert.c
parentfbcba8aa5e4e9dd3eab5d0c508b8dfcd3cd3ad5f (diff)
r494
git-svn-id: https://recordmydesktop.svn.sourceforge.net/svnroot/recordmydesktop/trunk@504 f606c939-3180-4ac9-a4b8-4b8779d57d0a
Diffstat (limited to 'recordmydesktop/src/rectinsert.c')
-rw-r--r--recordmydesktop/src/rectinsert.c29
1 files changed, 14 insertions, 15 deletions
diff --git a/recordmydesktop/src/rectinsert.c b/recordmydesktop/src/rectinsert.c
index d65dc76..1eaa9ef 100644
--- a/recordmydesktop/src/rectinsert.c
+++ b/recordmydesktop/src/rectinsert.c
@@ -269,27 +269,19 @@ int CollideRects(WGeometry *wgeom1,
}
}
-/**
- * If needed, grow the passed geometry so its position and size
- * becomes even.
- */
-static void MakeGeometryEven(WGeometry *wgeom){
+int RectInsert(RectArea **root,WGeometry *wgeom){
+ int total_insertions=0;
+ RectArea *temp=NULL,*newnode=(RectArea *)malloc(sizeof(RectArea));
+ //align
+ //we do need to know boundaries
wgeom->width+=(wgeom->width%2)|(wgeom->x%2);
wgeom->height+=(wgeom->height%2)|(wgeom->y%2);
wgeom->width+=(wgeom->width%2);
wgeom->height+=(wgeom->height%2);
wgeom->x-=wgeom->x%2;
wgeom->y-=wgeom->y%2;
-
-}
-
-int RectInsert(RectArea **root,WGeometry *wgeom){
-
- int total_insertions=0;
- RectArea *temp=NULL,*newnode=(RectArea *)malloc(sizeof(RectArea));
-
- MakeGeometryEven(wgeom);
+// fprintf(stderr," %d %d %d %d\n",wgeom->x,
newnode->geom.x=wgeom->x;
newnode->geom.y=wgeom->y;
@@ -314,7 +306,14 @@ int RectInsert(RectArea **root,WGeometry *wgeom){
insert_ok=1;
else{
for(i=0;i<ngeoms;i++){
- MakeGeometryEven(wgeom_return[i]);
+ wgeom_return[i]->width+=(wgeom_return[i]->width%2)|
+ (wgeom_return[i]->x%2);
+ wgeom_return[i]->height+=(wgeom_return[i]->height%2)|
+ (wgeom_return[i]->y%2);
+ wgeom_return[i]->width+=(wgeom_return[i]->width%2);
+ wgeom_return[i]->height+=(wgeom_return[i]->height%2);
+ wgeom_return[i]->x-=wgeom_return[i]->x%2;
+ wgeom_return[i]->y-=wgeom_return[i]->y%2;
}
insert_ok=0;
switch(collres){
© All Rights Reserved