When implementing a custom measure function there is currently no way of knowing of the width and height passed in refer to an exact height and width or a maximum value. For example when centering a node with a custom measure function it will be passed the width and height of its parent as this is the maximum size it can be measured at. The node being measured does not have this information however and will have to make a guess.
I suggest we add something along the lines of android's concept of measurement modes (MeasureSpec). so that nodes being measured know whether they must measure to a size exactly, at most, or if the can just ignore it totally (this is currently encoded in the size by looking for NaN).
@lucasr @vjeux
When implementing a custom measure function there is currently no way of knowing of the width and height passed in refer to an exact height and width or a maximum value. For example when centering a node with a custom measure function it will be passed the width and height of its parent as this is the maximum size it can be measured at. The node being measured does not have this information however and will have to make a guess.
I suggest we add something along the lines of android's concept of measurement modes (MeasureSpec). so that nodes being measured know whether they must measure to a size exactly, at most, or if the can just ignore it totally (this is currently encoded in the size by looking for NaN).
@lucasr @vjeux