That patch joins any two adjacent areas.
How it works:
consider:
join_area func(ar1, ar2) {
First, we see if edges of ar->edge[top] and ar2->edge[top] can align.
If they can we align them and skip to the next two edges, if not we have to make an additional split in order to align.
After the split, we have one new area that we don't want, so we join the new area with any neighbor (ar4 on the picture) right of the new area in range (ar3->v4.y; ar3->v2.y). How do we do that? we call collapse_at_edge()
After that first two edges are aligned and we don't have any additional areas.
So, we do the same procedure with the other two edges (ar1->edge[bottom & ar2->edge[bottom]).
And now we have two perfectly aligned areas ar1 and ar2, so we just join em calling join aligned_areas(ar1, ar2)
}
ALL "//COMMENTED CODE" REQUIRE THAT PATCH https://developer.blender.org/D8114




