Exemple #1
0
        public override RectCallback getRectCallback(RenderBox referenceBox)
        {
            return(() => {
                RenderObject cell = referenceBox;
                AbstractNodeMixinDiagnosticableTree table = cell.parent;
                Matrix4 transform = Matrix4.identity();
                while (table is RenderObject && !(table is RenderTable))
                {
                    RenderObject parentBox = table as RenderObject;
                    parentBox.applyPaintTransform(cell, transform);
                    D.assert(table == cell.parent);
                    cell = parentBox;
                    table = table.parent;
                }

                if (table is RenderTable renderTable)
                {
                    TableCellParentData cellParentData = cell.parentData as TableCellParentData;
                    Rect rect = renderTable.getRowBox(cellParentData.y);
                    // The rect is in the table's coordinate space. We need to change it to the
                    // TableRowInkWell's coordinate space.
                    renderTable.applyPaintTransform(cell, transform);
                    Offset offset = MatrixUtils.getAsTranslation(transform);
                    if (offset != null)
                    {
                        return rect.shift(-offset);
                    }
                }

                return Rect.zero;
            }
                   );
        }
 protected void redepthChild(AbstractNodeMixinDiagnosticableTree child)
 {
     D.assert(child.owner == owner);
     if (child._depth <= _depth)
     {
         child._depth = _depth + 1;
         child.redepthChildren();
     }
 }
        protected override void adoptChild(AbstractNodeMixinDiagnosticableTree childNode)
        {
            base.adoptChild(childNode);
            var child           = (RenderBox)childNode;
            var childParentData = (SliverMultiBoxAdaptorParentData)child.parentData;

            if (!childParentData._keptAlive)
            {
                this.childManager.didAdoptChild(child);
            }
        }
        protected virtual void dropChild(AbstractNodeMixinDiagnosticableTree child)
        {
            D.assert(child != null);
            D.assert(child._parent == this);
            D.assert(child.attached == attached);

            child._parent = null;
            if (attached)
            {
                child.detach();
            }
        }
Exemple #5
0
        public override void applyParentData(RenderObject renderObject)
        {
            TableCellParentData parentData = renderObject.parentData as TableCellParentData;

            if (parentData.verticalAlignment != verticalAlignment)
            {
                parentData.verticalAlignment = verticalAlignment;
                AbstractNodeMixinDiagnosticableTree targetParent = renderObject.parent;
                if (targetParent is RenderObject)
                {
                    ((RenderObject)targetParent).markNeedsLayout();
                }
            }
        }
        public override void applyParentData(RenderObject renderObject)
        {
            D.assert(renderObject.parentData is _ActionButtonParentData);
            _ActionButtonParentData parentData =
                renderObject.parentData as _ActionButtonParentData;

            if (parentData.isPressed != isPressed)
            {
                parentData.isPressed = isPressed;
                AbstractNodeMixinDiagnosticableTree targetParent = renderObject.parent;
                if (targetParent is RenderObject)
                {
                    ((RenderObject)targetParent).markNeedsPaint();
                }
            }
        }
Exemple #7
0
        protected virtual void adoptChild(AbstractNodeMixinDiagnosticableTree child)
        {
            D.assert(child != null);
            D.assert(child._parent == null);
            D.assert(() => {
                var node = this;
                while (node.parent != null)
                {
                    node = node.parent;
                }
                D.assert(node != child); // indicates we are about to create a cycle
                return(true);
            });

            child._parent = this;
            if (attached)
            {
                child.attach(_owner);
            }
            redepthChild(child);
        }
Exemple #8
0
 protected override void adoptChild(AbstractNodeMixinDiagnosticableTree child)
 {
     this.markNeedsAddToScene();
     base.adoptChild(child);
 }