From 20be26d3698eeeeaf2c0a9e55a28831466fc0bd1 Mon Sep 17 00:00:00 2001 From: Sebastian Geerken Date: Sat, 31 Jan 2015 17:15:19 +0100 Subject: Relative positions, part 6 (hopefully last): calculating the positions. --- dw/oofpositionedmgr.hh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'dw/oofpositionedmgr.hh') diff --git a/dw/oofpositionedmgr.hh b/dw/oofpositionedmgr.hh index 272cc62b..2962a9d1 100644 --- a/dw/oofpositionedmgr.hh +++ b/dw/oofpositionedmgr.hh @@ -34,16 +34,16 @@ protected: , Child> *childrenByWidget; - inline int getPosLeft (core::Widget *child, int availWidth) - { return getPosBorder (child->getStyle()->left, availWidth); } - inline int getPosRight (core::Widget *child, int availWidth) - { return getPosBorder (child->getStyle()->right, availWidth); } - inline int getPosTop (core::Widget *child, int availHeight) - { return getPosBorder (child->getStyle()->top, availHeight); } - inline int getPosBottom (core::Widget *child, int availHeight) - { return getPosBorder (child->getStyle()->bottom, availHeight); } - - int getPosBorder (core::style::Length cssValue, int refLength); + inline bool getPosLeft (core::Widget *child, int availWidth, int *result) + { return getPosBorder (child->getStyle()->left, availWidth, result); } + inline bool getPosRight (core::Widget *child, int availWidth, int *result) + { return getPosBorder (child->getStyle()->right, availWidth, result); } + inline bool getPosTop (core::Widget *child, int availHeight, int *result) + { return getPosBorder (child->getStyle()->top, availHeight, result); } + inline bool getPosBottom (core::Widget *child, int availHeight, int *result) + { return getPosBorder (child->getStyle()->bottom, availHeight, result); } + + bool getPosBorder (core::style::Length cssValue, int refLength, int *result); public: OOFPositionedMgr (OOFAwareWidget *container); -- cgit v1.2.3