]> git.decadent.org.uk Git - ion3.git/blobdiff - mod_tiling/split.c
Imported Upstream version 20090110
[ion3.git] / mod_tiling / split.c
index 568a2d1a139766801a755d6b132a4c345cbba6d5..5e1abb47dcb9961145032f6210eb30cb95ae5f0c 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * ion/mod_tiling/split.c
  *
- * Copyright (c) Tuomo Valkonen 1999-2007
+ * Copyright (c) Tuomo Valkonen 1999-2009
  *
  * See the included file LICENSE for details.
  */
@@ -1234,13 +1234,23 @@ static void splitsplit_remove(WSplitSplit *node, WSplit *child,
     static int nstdisp=0;
     WSplitInner *parent;
     WSplit *other;
+    int hprimn=PRIMN_ANY, vprimn=PRIMN_ANY;
     
     assert(node->tl==child || node->br==child);
     
-    if(node->tl==child)
+    if(node->tl==child){
         other=node->br;
-    else
+        if(node->dir==SPLIT_VERTICAL)
+            vprimn=PRIMN_TL;
+        else
+            hprimn=PRIMN_TL;
+    }else{
         other=node->tl;
+        if(node->dir==SPLIT_VERTICAL)
+            vprimn=PRIMN_BR;
+        else
+            hprimn=PRIMN_BR;
+    }
     
     assert(other!=NULL);
 
@@ -1262,7 +1272,7 @@ static void splitsplit_remove(WSplitSplit *node, WSplit *child,
         splittree_changeroot((WSplit*)node, other);
     
     if(reclaim_space)
-        split_resize(other, &(((WSplit*)node)->geom), PRIMN_ANY, PRIMN_ANY);
+        split_resize(other, &(((WSplit*)node)->geom), hprimn, vprimn);
     
     child->parent=NULL;