コード例 #1
0
        public void validate()
        {
            if (!_layoutEnabled)
            {
                return;
            }

            if (fillParent && parent != null)
            {
                var   stage = getStage();
                float parentWidth, parentHeight;

                if (stage != null && parent == stage.getRoot())
                {
                    parentWidth  = stage.getWidth();
                    parentHeight = stage.getHeight();
                }
                else
                {
                    parentWidth  = parent.getWidth();
                    parentHeight = parent.getHeight();
                }

                if (width != parentWidth || height != parentHeight)
                {
                    setSize(parentWidth, parentHeight);
                    invalidate();
                }
            }

            if (!_needsLayout)
            {
                return;
            }

            _needsLayout = false;
            layout();
        }