summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Geerken <devnull@localhost>2014-07-09 23:46:06 +0200
committerSebastian Geerken <devnull@localhost>2014-07-09 23:46:06 +0200
commita207166a14f8587104ab5eb0ada66b796ce9ccfd (patch)
treec8aa12d8c10dc6ddc25a5fc5cc9046b8048f1c06
parent0a1e5401561831a5415a3da11621addd2b4b9bc7 (diff)
OutOfFlowMgr::doFloatsExceedCB: check agains requisition, not allocation of the CB. Fixes a CPU hogging bug.
-rw-r--r--dw/outofflowmgr.cc20
1 files changed, 12 insertions, 8 deletions
diff --git a/dw/outofflowmgr.cc b/dw/outofflowmgr.cc
index bc4f7f59..d9436cb9 100644
--- a/dw/outofflowmgr.cc
+++ b/dw/outofflowmgr.cc
@@ -901,6 +901,14 @@ bool OutOfFlowMgr::doFloatsExceedCB (Side side)
{
DBG_OBJ_ENTER ("resize.oofm", 0, "doFloatsExceedCB", "%s",
side == LEFT ? "LEFT" : "RIGHT");
+
+ // This method is called to determine whether the *requisition* of
+ // the CB must be recalculated. So, we check the float allocations
+ // against the *requisition* of the CB, which may (e. g. within
+ // tables) differ from the new allocation. (Generally, a widget may
+ // allocated at a different size.)
+ core::Requisition cbReq;
+ containingBlock->sizeRequest (&cbReq);
SortedFloatsVector *list = side == LEFT ? leftFloatsCB : rightFloatsCB;
bool exceeds = false;
@@ -916,14 +924,10 @@ bool OutOfFlowMgr::doFloatsExceedCB (Side side)
"(%d, %d, %d * %d)?",
fla->x, fla->y, fla->width, fla->ascent + fla->descent,
containingBlockAllocation.x, containingBlockAllocation.y,
- containingBlockAllocation.width,
- containingBlockAllocation.ascent
- + containingBlockAllocation.descent);
- if (fla->x + fla->width >
- containingBlockAllocation.x + containingBlockAllocation.width ||
- fla->y + fla->ascent + fla->descent >
- containingBlockAllocation.y + containingBlockAllocation.ascent
- + containingBlockAllocation.descent) {
+ cbReq.width, cbReq.ascent + cbReq.descent);
+ if (fla->x + fla->width > containingBlockAllocation.x + cbReq.width ||
+ fla->y + fla->ascent + fla->descent
+ > containingBlockAllocation.y + cbReq.ascent + cbReq.descent) {
exceeds = true;
DBG_OBJ_MSG ("resize.oofm", 2, "Yes.");
} else