diff options
author | Sebastian Geerken <devnull@localhost> | 2015-01-31 17:15:19 +0100 |
---|---|---|
committer | Sebastian Geerken <devnull@localhost> | 2015-01-31 17:15:19 +0100 |
commit | 20be26d3698eeeeaf2c0a9e55a28831466fc0bd1 (patch) | |
tree | dd0388e3b11d9a409809609f1bf946964ebb58f4 /dw/oofpositionedmgr.cc | |
parent | eac1c960c8c875715fdb8d123e4c19302d93eb00 (diff) |
Relative positions, part 6 (hopefully last): calculating the positions.
Diffstat (limited to 'dw/oofpositionedmgr.cc')
-rw-r--r-- | dw/oofpositionedmgr.cc | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/dw/oofpositionedmgr.cc b/dw/oofpositionedmgr.cc index 5834a729..fc4ad938 100644 --- a/dw/oofpositionedmgr.cc +++ b/dw/oofpositionedmgr.cc @@ -169,7 +169,7 @@ void OOFPositionedMgr::tellPosition1 (Widget *widget, int x, int y) void OOFPositionedMgr::tellPosition2 (Widget *widget, int x, int y) { - DBG_OBJ_ENTER ("resize.oofm", 0, "tellPosition", "%p, %d, %d", + DBG_OBJ_ENTER ("resize.oofm", 0, "tellPosition2", "%p, %d, %d", widget, x, y); TypedPointer<Widget> key (widget); @@ -264,15 +264,18 @@ Widget *OOFPositionedMgr::getWidget (int i) return children->get(i)->widget; } -int OOFPositionedMgr::getPosBorder (style::Length cssValue, int refLength) +bool OOFPositionedMgr::getPosBorder (style::Length cssValue, int refLength, + int *result) { - if (style::isAbsLength (cssValue)) - return style::absLengthVal (cssValue); - else if (style::isPerLength (cssValue)) - return style::multiplyWithPerLength (refLength, cssValue); - else - // -1 means "undefined": - return -1; + if (style::isAbsLength (cssValue)) { + *result = style::absLengthVal (cssValue); + return true; + } else if (style::isPerLength (cssValue)) { + *result = style::multiplyWithPerLength (refLength, cssValue); + return true; + } else + // "false" means "undefined": + return false; } } // namespace oof |