Nez.Portable/UI/Base/Element.cs
/// <summary>
/// Converts coordinates for this element to those of a parent element. The ascendant does not need to be a direct parent
/// </summary>
/// <returns>The to ascendant coordinates.</returns>
/// <param name="ascendant">Ascendant.</param>
/// <param name="localCoords">Local coords.</param>
Converts coordinates for this element to those of a parent element. The ascendant does not need to be a direct parent
Converts coordinates for this element to those of a parent element . The ascendant does not need to be a direct parent
public Vector2 localToAscendantCoordinates(Element ascendant, Vector2 localCoords)
        {
            Element element = this;
            while (element != null)
            {
                localCoords = element.localToParentCoordinates(localCoords);
                element = element.parent;
                if (element == ascendant)
                    break;
            }
            return localCoords;
        }
public Vector2 localToAscendantCoordinates ( Element ascendant , Vector2 localCoords ) { Element element = this ; while ( element != null ) { localCoords = element . localToParentCoordinates ( localCoords ) ; element = element . parent ; if ( element == ascendant ) break ; } return localCoords ; }
Converts coordinates for this element to those of a parent element.
Converts coordinates for this element to those of a parent element .
The to ascendant coordinates.
The to ascendant coordinates .
ascendant
Element
None
localCoords
Vector2
None