aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dw/ooffloatsmgr.cc11
-rw-r--r--dw/textblock.cc15
2 files changed, 13 insertions, 13 deletions
diff --git a/dw/ooffloatsmgr.cc b/dw/ooffloatsmgr.cc
index 0b110167..ca83f999 100644
--- a/dw/ooffloatsmgr.cc
+++ b/dw/ooffloatsmgr.cc
@@ -1709,8 +1709,15 @@ void OOFFloatsMgr::getSize (Requisition *cbReq, int *oofWidth, int *oofHeight)
getFloatsSize (cbReq, LEFT, &oofWidthtLeft, &oofHeightLeft);
getFloatsSize (cbReq, RIGHT, &oofWidthRight, &oofHeightRight);
- *oofWidth = max (oofWidthtLeft, oofWidthRight);
- *oofHeight = max (oofHeightLeft, oofHeightRight);
+ // Floats must be within the *content* area of the containing
+ // block, not its *margin* area (which is equivalent to the
+ // requisition / allocation). For this reason, boxRestWidth() and
+ // boxRestHeight() are added here.
+
+ *oofWidth =
+ max (oofWidthtLeft, oofWidthRight) + containingBlock->boxRestWidth ();
+ *oofHeight =
+ max (oofHeightLeft, oofHeightRight) + containingBlock->boxRestHeight ();
DBG_OBJ_MSGF ("resize.oofm", 1,
"=> (l: %d, r: %d => %d) * (l: %d, r: %d => %d)",
diff --git a/dw/textblock.cc b/dw/textblock.cc
index 15ab6681..c2330bb1 100644
--- a/dw/textblock.cc
+++ b/dw/textblock.cc
@@ -424,17 +424,10 @@ void Textblock::sizeRequestImpl (core::Requisition *requisition)
outOfFlowMgr[i]->getSize (requisition, &oofWidth, &oofHeight);
- // Widgets OOF must be within the *content* area, not the
- // *margin* area (which is equivalent to the requisition /
- // allocation). For this reason, boxRestWidth() and
- // boxRestHeight() must be considered.
-
- if (oofWidth + boxRestWidth () > requisition->width)
- requisition->width = oofWidth + boxRestWidth ();
- if (oofHeight + boxRestHeight ()
- > requisition->ascent + requisition->descent)
- requisition->descent =
- oofHeight + boxRestHeight () - requisition->ascent;
+ if (oofWidth > requisition->width)
+ requisition->width = oofWidth;
+ if (oofHeight > requisition->ascent + requisition->descent)
+ requisition->descent = oofHeight - requisition->ascent;
}
}