diff options
author | Sebastian Geerken <devnull@localhost> | 2016-01-03 14:05:11 +0100 |
---|---|---|
committer | Sebastian Geerken <devnull@localhost> | 2016-01-03 14:05:11 +0100 |
commit | 85ed5cc02e6787450cbeb7cecdd5560c9616e6d0 (patch) | |
tree | d889665d57f70aecb6c01eaf8fceb59f02c292dd /dw/ooffloatsmgr.cc | |
parent | 17043e7f6c74e756c24347f40a9701ac10e6acbf (diff) |
Fix (first half of) problem with "clear" position.
Diffstat (limited to 'dw/ooffloatsmgr.cc')
-rw-r--r-- | dw/ooffloatsmgr.cc | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/dw/ooffloatsmgr.cc b/dw/ooffloatsmgr.cc index 5b4aee9a..52f79954 100644 --- a/dw/ooffloatsmgr.cc +++ b/dw/ooffloatsmgr.cc @@ -1165,9 +1165,6 @@ int OOFFloatsMgr::getFloatHeight (Side side, int y, int h, return height; } -/** - * Returns position relative to the textblock "tb". - */ int OOFFloatsMgr::getClearPosition (OOFAwareWidget *widget) { DBG_OBJ_ENTER ("resize.oofm", 0, "getClearPosition", "%p", widget); @@ -1189,9 +1186,7 @@ int OOFFloatsMgr::getClearPosition (OOFAwareWidget *widget) } else pos = 0; - DBG_OBJ_MSGF ("resize.oofm", 1, "=> %d", pos); - DBG_OBJ_LEAVE (); - + DBG_OBJ_LEAVE_VAL ("%d", pos); return pos; } @@ -1226,8 +1221,12 @@ int OOFFloatsMgr::getClearPosition (OOFAwareWidget *widget, Side side) Float *vloat = list->get(i); assert (vloat->generator != widget); ensureFloatSize (vloat); - pos = max (vloat->yReal + vloat->size.ascent + vloat->size.descent - - vloat->generator->getGeneratorY (oofmIndex), 0); + int yRel = widget->getGeneratorY (oofmIndex); + pos = max (vloat->yReal + vloat->size.ascent + vloat->size.descent - yRel, + 0); + DBG_OBJ_MSGF ("resize.oofm", 1, "pos = max (%d + %d + %d - %d, 0)", + vloat->yReal, vloat->size.ascent, vloat->size.descent, + yRel); } DBG_OBJ_LEAVE_VAL ("%d", pos); |