aboutsummaryrefslogtreecommitdiff
path: root/dw
diff options
context:
space:
mode:
authorSebastian Geerken <devnull@localhost>2016-01-03 14:05:11 +0100
committerSebastian Geerken <devnull@localhost>2016-01-03 14:05:11 +0100
commit85ed5cc02e6787450cbeb7cecdd5560c9616e6d0 (patch)
treed889665d57f70aecb6c01eaf8fceb59f02c292dd /dw
parent17043e7f6c74e756c24347f40a9701ac10e6acbf (diff)
Fix (first half of) problem with "clear" position.
Diffstat (limited to 'dw')
-rw-r--r--dw/ooffloatsmgr.cc15
-rw-r--r--dw/outofflowmgr.hh3
-rw-r--r--dw/textblock.cc2
3 files changed, 11 insertions, 9 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);
diff --git a/dw/outofflowmgr.hh b/dw/outofflowmgr.hh
index 5ded99d5..209ae42c 100644
--- a/dw/outofflowmgr.hh
+++ b/dw/outofflowmgr.hh
@@ -129,6 +129,9 @@ public:
virtual bool affectsRightBorder (core::Widget *widget) = 0;
virtual bool mayAffectBordersAtAll () = 0;
+ /**
+ * Return value is relative to the *calling generator* (not container).
+ */
virtual int getClearPosition (OOFAwareWidget *widget) = 0;
virtual bool dealingWithSizeOfChild (core::Widget *child) = 0;
diff --git a/dw/textblock.cc b/dw/textblock.cc
index 2dfb29bc..95b4f0c9 100644
--- a/dw/textblock.cc
+++ b/dw/textblock.cc
@@ -747,7 +747,7 @@ void Textblock::calcExtraSpaceImpl (bool vertical)
if (vertical) {
int clearPosition = 0;
for (int i = 0; i < NUM_OOFM; i++)
- if (searchOutOfFlowMgr (i))
+ if (searchOutOfFlowMgr (i) && findSizeRequestReference (i, NULL, NULL))
clearPosition =
misc::max (clearPosition,
searchOutOfFlowMgr(i)->getClearPosition (this));