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; } ); }
public override void applyParentData(RenderObject renderObject) { TableCellParentData parentData = (TableCellParentData)renderObject.parentData; if (parentData.verticalAlignment != this.verticalAlignment) { parentData.verticalAlignment = this.verticalAlignment; AbstractNodeMixinDiagnosticableTree targetParent = renderObject.parent; if (targetParent is RenderObject) { ((RenderObject)targetParent).markNeedsLayout(); } } }
protected override void removeChildRenderObject(RenderObject child) { D.assert(() => { if (this._debugWillReattachChildren) { return(true); } foreach (Element forgottenChild in this._forgottenChildren) { if (forgottenChild.renderObject == child) { return(true); } } return(false); }); TableCellParentData childParentData = (TableCellParentData)child.parentData; this.renderObject.setChild(childParentData.x, childParentData.y, null); }
protected override void removeChildRenderObject(RenderObject child) { TableCellParentData childParentData = child.parentData as TableCellParentData; renderObject.setChild(childParentData.x, childParentData.y, null); }