diff options
author | Sebastian Geerken <devnull@localhost> | 2014-09-02 00:28:59 +0200 |
---|---|---|
committer | Sebastian Geerken <devnull@localhost> | 2014-09-02 00:28:59 +0200 |
commit | 7d84e4f6725dbf62d55753e21f8a09be5370bdc7 (patch) | |
tree | 2ecbabcc2660b9fbb684dc0cfa2f3267cd665f49 | |
parent | 42d6755811a82977d70dae3ae6d5e35920f2740f (diff) |
OOFM::getSize() refers to CB allocation, not content area.
-rw-r--r-- | dw/ooffloatsmgr.cc | 11 | ||||
-rw-r--r-- | dw/textblock.cc | 15 |
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; } } |