FlexLayout icon indicating copy to clipboard operation
FlexLayout copied to clipboard

Is there a way to determine if a node is on an edge?

Open vegemite4me opened this issue 4 years ago • 1 comments

This is a great piece of kit. Thank you for sharing this package.

I would like to know if it is possible to determine if a node (or is it tab?) is touching an edge. In my specific situation I need to know if that node is touching the bottom of the window, as I need to add an additional class to the contents of that node.

For example, here are three layouts. I need to know when a node is touching the bottom edge of the window - I have shaded these green.

flexlayout-bottom-edge

Is there a function I can call or a property I can check to find out if a node is touching an edge?

vegemite4me avatar Jan 21 '22 11:01 vegemite4me

you can use getRect https://rawgit.com/caplin/FlexLayout/demos/demos/v0.7/typedoc/classes/TabNode.html#getRect

then compare approximately (rect.y + rect.height) to the root layout container rect

eric-ho-github avatar Sep 15 '22 06:09 eric-ho-github