Esempio n. 1
0
    void SetLayout(FlexLayoutData data, float factor)
    {
        SetLayoutElementSize(data, factor);
        RectOffset rectOffset = GetPadding(data, factor);

        layoutGroup.padding        = rectOffset;
        layoutGroup.childAlignment = data.alignment;
    }
Esempio n. 2
0
    private static RectOffset GetPadding(FlexLayoutData data, float factor)
    {
        RectOffset rectOffset = new RectOffset();

        rectOffset.top    = (int)(data.padding.top * factor);
        rectOffset.bottom = (int)(data.padding.bottom * factor);
        rectOffset.left   = (int)(data.padding.left * factor);
        rectOffset.right  = (int)(data.padding.right * factor);
        return(rectOffset);
    }
Esempio n. 3
0
 private void SetLayoutElementSize(FlexLayoutData data, float factor)
 {
     firstChild.preferredWidth  = data.preferedFistChildSize * factor;
     secondChild.preferredWidth = data.preferedSecondChildSize * factor;
     thirdChild.preferredWidth  = data.preferedThirdChildSize * factor;
 }