compose method

String compose(
  1. String base
)

Overlays the debug panel above base using direct string manipulation.

If not enabled, returns base unchanged.

This is a lightweight alternative to using the UV Compositor, avoiding the overhead of Canvas allocation and cell-by-cell rendering.

Implementation

String compose(String base) {
  if (!enabled) return base;
  final p = panel();
  final bounds = panelBounds;

  // Fast path: overlay panel onto base using string manipulation
  return _overlayStrings(
    base,
    p,
    bounds.x,
    bounds.y,
    terminalWidth,
    terminalHeight,
  );
}