diff options
author | Sebastian Geerken <devnull@localhost> | 2014-08-29 19:00:08 +0200 |
---|---|---|
committer | Sebastian Geerken <devnull@localhost> | 2014-08-29 19:00:08 +0200 |
commit | 9430132423d99689de9c02db79df60fd1b4a5703 (patch) | |
tree | 8dd8f75e27d9789be5146560ef6557ef59fc589e /dw/outofflowmgr.cc | |
parent | cd2b7abca85195e32eff716ed15aa0b9051fe46a (diff) | |
parent | 16607bb593346401334d0988b2b25a3df3b5ce0d (diff) |
Merge with main repo.
Diffstat (limited to 'dw/outofflowmgr.cc')
-rw-r--r-- | dw/outofflowmgr.cc | 34 |
1 files changed, 27 insertions, 7 deletions
diff --git a/dw/outofflowmgr.cc b/dw/outofflowmgr.cc index 70f55fb0..3dd09ebd 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) |