performPaint method
Hook for subclasses to implement actual painting.
Implementation
@override
void performPaint(Buffer buffer, Offset offset) {
final split = widget as SplitPane;
split._lastArea = Rect(offset.dx, offset.dy, size.width, size.height);
final w = size.width;
final h = size.height;
if (w <= 0 || h <= 0) return;
final dividerPos = split._dividerX;
if (split.direction == LayoutDirection.horizontal) {
if (dividerPos > 0 && childElement1 != null) {
childElement1!.paint(buffer, offset + childElement1!.relativeOffset);
}
for (var y = 0; y < h; y++) {
buffer.setAttributes(
offset.dx + dividerPos,
offset.dy + y,
char: split.dividerChar,
fg: split.dividerStyle.foreground?.argb ?? 0,
bg: split.dividerStyle.background?.argb ?? 0,
modifiers: split.dividerStyle.modifiers,
);
}
final child2Width = w - dividerPos - 1;
if (child2Width > 0 && childElement2 != null) {
childElement2!.paint(buffer, offset + childElement2!.relativeOffset);
}
} else {
if (dividerPos > 0 && childElement1 != null) {
childElement1!.paint(buffer, offset + childElement1!.relativeOffset);
}
for (var x = 0; x < w; x++) {
buffer.setAttributes(
offset.dx + x,
offset.dy + dividerPos,
char: split.dividerChar,
fg: split.dividerStyle.foreground?.argb ?? 0,
bg: split.dividerStyle.background?.argb ?? 0,
modifiers: split.dividerStyle.modifiers,
);
}
final child2Height = h - dividerPos - 1;
if (child2Height > 0 && childElement2 != null) {
childElement2!.paint(buffer, offset + childElement2!.relativeOffset);
}
}
}