From 91330da45aa97bae532cbca20b4cca17ad8aa8d5 Mon Sep 17 00:00:00 2001 From: Sebastian Geerken Date: Sun, 25 May 2014 12:15:57 +0200 Subject: Worked around a problem with inconsistent extremes. --- dw/outofflowmgr.cc | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'dw/outofflowmgr.cc') diff --git a/dw/outofflowmgr.cc b/dw/outofflowmgr.cc index afc9220a..bbfe42e0 100644 --- a/dw/outofflowmgr.cc +++ b/dw/outofflowmgr.cc @@ -2202,12 +2202,7 @@ int OutOfFlowMgr::adjustFloatWidth (int width, Extremes *extremes) containingBlock->getAvailWidth()); DBG_OBJ_MSG_START (); - // Consider the available width of the containing block (when set): - if (width > containingBlock->getAvailWidth()) { - width = containingBlock->getAvailWidth(); - DBG_OBJ_MSGF ("resize.oofm", 1, "adjusted to availWidth: %d", width); - } - // Finally, consider extremes (as described above). + // Consider extremes (as described above). if (width < extremes->minWidth) { width = extremes->minWidth; DBG_OBJ_MSGF ("resize.oofm", 1, "adjusted to minWidth: %d", width); @@ -2216,6 +2211,15 @@ int OutOfFlowMgr::adjustFloatWidth (int width, Extremes *extremes) width = extremes->maxWidth; DBG_OBJ_MSGF ("resize.oofm", 1, "adjusted to maxWidth: %d", width); } + // Finally, consider the available width of the containing + // block. Order is important: to prevent problems, the available + // width of the float must never be larger than the one of the + // containing block. (Somewhat hackish, will be solved cleaner with + // GROWS.) + if (width > containingBlock->getAvailWidth()) { + width = containingBlock->getAvailWidth(); + DBG_OBJ_MSGF ("resize.oofm", 1, "adjusted to CB::availWidth: %d", width); + } DBG_OBJ_MSGF ("resize.oofm", 1, "=> %d", width); DBG_OBJ_MSG_END (); -- cgit v1.2.3