aboutsummaryrefslogtreecommitdiff
path: root/dw/outofflowmgr.cc
diff options
context:
space:
mode:
authorSebastian Geerken <devnull@localhost>2014-04-10 20:31:58 +0200
committerSebastian Geerken <devnull@localhost>2014-04-10 20:31:58 +0200
commit14c8dc8706be54b8ade7962455848eed299db765 (patch)
treeb172724f91e8c1f389b32ed829f234a1c82509f3 /dw/outofflowmgr.cc
parent2f053c51c454e3051ccf736fdb8015a62dc220d1 (diff)
Floats are now allocated earlier.
Diffstat (limited to 'dw/outofflowmgr.cc')
-rw-r--r--dw/outofflowmgr.cc34
1 files changed, 16 insertions, 18 deletions
diff --git a/dw/outofflowmgr.cc b/dw/outofflowmgr.cc
index 50144c6f..3fcb6959 100644
--- a/dw/outofflowmgr.cc
+++ b/dw/outofflowmgr.cc
@@ -558,18 +558,16 @@ void OutOfFlowMgr::sizeAllocateEnd (Textblock *caller)
DBG_OBJ_MSGF ("resize.oofm", 0, "<b>sizeAllocateEnd</b> (%p)", caller);
DBG_OBJ_MSG_START ();
+ // Floats (and later absolutely positioned blocks) have to be allocated.
+ TBInfo *tbInfo = getTextblock (caller);
+ sizeAllocateFloats (tbInfo, LEFT);
+ sizeAllocateFloats (tbInfo, RIGHT);
+
if (caller == containingBlock) {
// Move floats from GB lists to the one CB list.
moveFromGBToCB (LEFT);
moveFromGBToCB (RIGHT);
-
- // Floats and absolutely positioned blocks have to be allocated
- sizeAllocateFloats (LEFT);
- sizeAllocateFloats (RIGHT);
- sizeAllocateAbsolutelyPositioned ();
-
- // Textblocks have already been allocated here.
-
+
// Check changes of both textblocks and floats allocation. (All
// is checked by hasRelationChanged (...).)
for (lout::container::typed::Iterator<TypedPointer <Textblock> > it =
@@ -971,23 +969,23 @@ void OutOfFlowMgr::moveFromGBToCB (Side side)
// printf (" %d: %s\n", i, dest->get(i)->toString());
}
-void OutOfFlowMgr::sizeAllocateFloats (Side side)
+void OutOfFlowMgr::sizeAllocateFloats (TBInfo *textblock, Side side)
{
- SortedFloatsVector *list = side == LEFT ? leftFloatsCB : rightFloatsCB;
+ SortedFloatsVector *list = side == LEFT ?
+ textblock->leftFloatsGB : textblock->rightFloatsGB;
+
+ Allocation *gba = &(textblock->allocation);
+ Allocation *cba = &containingBlockAllocation;
+ int availWidth = textblock->getTextblock()->getAvailWidth();
for (int i = 0; i < list->size(); i++) {
Float *vloat = list->get(i);
ensureFloatSize (vloat);
- Allocation *gbAllocation = getAllocation(vloat->generatingBlock);
- Allocation *cbAllocation = getAllocation(containingBlock);
-
Allocation childAllocation;
- childAllocation.x = cbAllocation->x +
- calcFloatX (vloat, side, gbAllocation->x - cbAllocation->x,
- gbAllocation->width,
- vloat->generatingBlock->getAvailWidth());
- childAllocation.y = gbAllocation->y + vloat->yReal;
+ childAllocation.x = cba->x +
+ calcFloatX (vloat, side, gba->x - cba->x, gba->width, availWidth);
+ childAllocation.y = gba->y + vloat->yReal;
childAllocation.width = vloat->size.width;
childAllocation.ascent = vloat->size.ascent;
childAllocation.descent = vloat->size.descent;