aboutsummaryrefslogtreecommitdiff
path: root/dw/outofflowmgr.cc
diff options
context:
space:
mode:
Diffstat (limited to 'dw/outofflowmgr.cc')
-rw-r--r--dw/outofflowmgr.cc34
1 files changed, 27 insertions, 7 deletions
diff --git a/dw/outofflowmgr.cc b/dw/outofflowmgr.cc
index caa7fee5..d9c19cc5 100644
--- a/dw/outofflowmgr.cc
+++ b/dw/outofflowmgr.cc
@@ -217,16 +217,36 @@ int OutOfFlowMgr::Float::ComparePosition::compare (Object *o1, Object *o2)
bool a2 = fl2->getWidget () ? fl2->getWidget()->wasAllocated () : true;
DBG_OBJ_MSGF_O ("border", 2, oofm,
- "float 1 allocated: %s; float 2 allocated: %s",
- a1 ? "yes" : "no", a2 ? "yes" : "no");
+ "float 1 (%p) allocated: %s; float 2 (%p) allocated: %s",
+ fl1->getWidget (), a1 ? "yes" : "no", fl2->getWidget (),
+ a2 ? "yes" : "no");
if (a1 && a2) {
- int fly1 = fl1->getWidget() ? fl1->getWidget()->getAllocation()->y :
- oofm->getAllocation(fl1->generatingBlock)->y + fl1->yReal;
- int fly2 = fl2->getWidget() ? fl2->getWidget()->getAllocation()->y :
- oofm->getAllocation(fl2->generatingBlock)->y + fl2->yReal;
- DBG_OBJ_MSGF_O ("border", 2, oofm, "y diff = %d - %d", fly1, fly2);
+ int fly1, fly2;
+
+ if (fl1->getWidget()) {
+ fly1 = fl1->getWidget()->getAllocation()->y;
+ DBG_OBJ_MSGF_O ("border", 2, oofm, "fly1 = %d", fly1);
+ } else {
+ fly1 = oofm->getAllocation(fl1->generatingBlock)->y + fl1->yReal;
+ DBG_OBJ_MSGF_O ("border", 2, oofm, "fly1 = %d + %d = %d",
+ oofm->getAllocation(fl1->generatingBlock)->y,
+ fl1->yReal, fly1);
+ }
+
+ if (fl2->getWidget()) {
+ fly2 = fl2->getWidget()->getAllocation()->y;
+ DBG_OBJ_MSGF_O ("border", 2, oofm, "fly2 = %d", fly2);
+ } else {
+ fly2 = oofm->getAllocation(fl2->generatingBlock)->y + fl2->yReal;
+ DBG_OBJ_MSGF_O ("border", 2, oofm, "fly2 = %d + %d = %d",
+ oofm->getAllocation(fl2->generatingBlock)->y,
+ fl2->yReal, fly2);
+ }
+
r = fly1 - fly2;
+
+ DBG_OBJ_MSGF_O ("border", 2, oofm, "r = %d - %d = %d", fly1, fly2, r);
} else if (a1 && !a2)
r = -1;
else if (!a1 && a2)