paintChild method
Paint a child RenderObject.
If the child has its own composited layer, the child will be composited into the layer subtree associated with this painting context. Otherwise, the child will be painted into the current PictureLayer for this context.
Implementation
@override
void paintChild(RenderObject child, Offset offset) {
if (calculateRects) {
if (child is RenderParagraph) {
currentText = child.text.toPlainText();
} else if (child is RenderEditable) {
currentText = child.plainText;
if (currentText != null && currentText!.isNotEmpty) {
final boxes = child.getBoxesForSelection(
TextSelection(baseOffset: 0, extentOffset: currentText!.length),
);
final paintOffset = _editablePaintOffset(child);
for (final b in boxes) {
spoilerRects.add(_normalizeEditableRect(
b.toRect().shift(offset + paintOffset), child));
}
}
}
}
super.paintChild(child, offset);
currentText = null;
}