diff options
author | Sebastian Geerken <devnull@localhost> | 2014-08-09 13:45:20 +0200 |
---|---|---|
committer | Sebastian Geerken <devnull@localhost> | 2014-08-09 13:45:20 +0200 |
commit | aec97c43032a9b65dfe74ca6b742c841ebebd3aa (patch) | |
tree | 7173df3f03f3ddb092ad2dec672d670f57003ae3 /dw/outofflowmgr.cc | |
parent | c042eb7a412bc44c66c9e316a1f85cff3fc01727 (diff) |
Fixed OutOfFlowMgr::getFloatHeight.
Diffstat (limited to 'dw/outofflowmgr.cc')
-rw-r--r-- | dw/outofflowmgr.cc | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/dw/outofflowmgr.cc b/dw/outofflowmgr.cc index 2e6171ad..a924d107 100644 --- a/dw/outofflowmgr.cc +++ b/dw/outofflowmgr.cc @@ -2052,9 +2052,30 @@ int OutOfFlowMgr::getFloatHeight (Textblock *textblock, Side side, int y, int h, float on the respective side. */ Float *vloat = list->get(first); + int yRelToFloat; + + if (vloat->generatingBlock == textblock) { + yRelToFloat = y - vloat->yReal; + DBG_OBJ_MSGF ("border", 1, "caller is CB: yRelToFloat = %d - %d = %d", + y, vloat->yReal, yRelToFloat); + } else { + // The respective widgets are allocated; otherwise, hasFloat() would have + // returned false. + assert (wasAllocated (textblock)); + assert (vloat->getWidget()->wasAllocated ()); + + Allocation *tba = getAllocation(textblock), + *fla = vloat->getWidget()->getAllocation (); + yRelToFloat = y + fla->y - tba->y; + + DBG_OBJ_MSGF ("border", 1, + "caller is not CB: yRelToFloat = %d + %d - %d = %d", + y, fla->y, tba->y, yRelToFloat); + } + ensureFloatSize (vloat); - int height = vloat->size.ascent + vloat->size.descent + vloat->yReal - y; - + int height = vloat->size.ascent + vloat->size.descent + yRelToFloat; + DBG_OBJ_MSGF ("border", 1, "=> %d", height); DBG_OBJ_LEAVE (); return height; |