aboutsummaryrefslogtreecommitdiff
path: root/dw/oofposabslikemgr.cc
diff options
context:
space:
mode:
Diffstat (limited to 'dw/oofposabslikemgr.cc')
-rw-r--r--dw/oofposabslikemgr.cc57
1 files changed, 14 insertions, 43 deletions
diff --git a/dw/oofposabslikemgr.cc b/dw/oofposabslikemgr.cc
index 5afd6ec5..7d274f90 100644
--- a/dw/oofposabslikemgr.cc
+++ b/dw/oofposabslikemgr.cc
@@ -18,7 +18,6 @@
*/
#include "oofposabslikemgr.hh"
-#include "oofawarewidget.hh"
using namespace dw::core;
using namespace lout::misc;
@@ -385,8 +384,7 @@ bool OOFPosAbsLikeMgr::isHPosCalculable (Child *child, bool allocated)
{
DBG_OBJ_ENTER ("resize.oofm", 0, "isHPosCalculable", "[%p], %s",
child->widget, boolToStr (allocated));
- bool b =
- allocated || (isHPosComplete (child) && child->reference == container);
+ bool b = allocated || isHPosComplete (child);
DBG_OBJ_LEAVE_VAL ("%s", boolToStr (b));
return b;
}
@@ -395,8 +393,7 @@ bool OOFPosAbsLikeMgr::isVPosCalculable (Child *child, bool allocated)
{
DBG_OBJ_ENTER ("resize.oofm", 0, "isVPosCalculable", "[%p], %s",
child->widget, boolToStr (allocated));
- bool b =
- allocated || (isVPosComplete (child) && child->reference == container);
+ bool b = allocated || isVPosComplete (child);
DBG_OBJ_LEAVE_VAL ("%s", boolToStr (b));
return b;
}
@@ -475,28 +472,15 @@ void OOFPosAbsLikeMgr::calcHPosAndSizeChildOfChild (Child *child, int refWidth,
left, right, width, widthDefined ? "true" : "false");
if (xPtr) {
- if (!leftDefined && !rightDefined) {
- assert (child->generator == container ||
- (containerAllocationState != NOT_ALLOCATED
- && child->generator->wasAllocated ()));
- *xPtr =
- child->x + (child->generator == container ? 0 :
- child->generator->getAllocation()->x
- - (containerAllocation.x + containerBoxOffsetX ()));
- } else {
- assert (child->reference == container ||
- (containerAllocationState != NOT_ALLOCATED
- && child->reference->wasAllocated ()));
- int xBase = child->reference == container ? 0 :
- child->generator->getAllocation()->x - containerAllocation.x;
- DBG_OBJ_MSGF ("resize.oofm", 0, "=> xBase = %d", xBase);
-
+ if (!leftDefined && !rightDefined)
+ *xPtr = generatorPosX (child) + child->x;
+ else {
if (!leftDefined && rightDefined)
- *xPtr = xBase + refWidth - width - right;
+ *xPtr = refWidth - width - right;
else if (leftDefined && !rightDefined)
- *xPtr = xBase + left;
+ *xPtr = left;
else {
- *xPtr = xBase + left;
+ *xPtr = left;
if (!widthDefined) {
width = refWidth - (left + right);
DBG_OBJ_MSGF ("resize.oofm", 0, "=> width (corrected) = %d",
@@ -555,28 +539,15 @@ void OOFPosAbsLikeMgr::calcVPosAndSizeChildOfChild (Child *child, int refHeight,
heightDefined ? "true" : "false");
if (yPtr) {
- if (!topDefined && !bottomDefined) {
- assert (child->generator == container ||
- (containerAllocationState != NOT_ALLOCATED
- && child->generator->wasAllocated ()));
- *yPtr =
- child->y + (child->generator == container ? 0 :
- child->generator->getAllocation()->y
- - (containerAllocation.y + containerBoxOffsetY ()));
- } else {
- assert (child->reference == container ||
- (containerAllocationState != NOT_ALLOCATED
- && child->reference->wasAllocated ()));
- int yBase = child->reference == container ? 0 :
- child->generator->getAllocation()->y - containerAllocation.y;
- DBG_OBJ_MSGF ("resize.oofm", 0, "=> yBase = %d", yBase);
-
+ if (!topDefined && !bottomDefined)
+ *yPtr = generatorPosY (child) + child->y;
+ else {
if (!topDefined && bottomDefined)
- *yPtr = yBase + refHeight - (ascent + descent) - bottom;
+ *yPtr = refHeight - (ascent + descent) - bottom;
else if (topDefined && !bottomDefined)
- *yPtr = yBase + top;
+ *yPtr = top;
else {
- *yPtr = yBase + top;
+ *yPtr = top;
if (!heightDefined) {
int height = refHeight - (top + bottom);
splitHeightPreserveAscent (height, &ascent, &descent);