layoutInsertionPreview method

ChantLayoutElement? layoutInsertionPreview(
  1. ChantContext ctxt
)

Implementation

ChantLayoutElement? layoutInsertionPreview(ChantContext ctxt) {
  final x = insertionPreview?.bounds.x;
  return switch (insertionPreview) {
    ChantNotationElement n =>
      n
        ..performLayout(ctxt)
        ..bounds = n.bounds.copyWith(x: x),
    Accent a =>
      a
        ..performLayout(ctxt)
        ..bounds = a.bounds.copyWith(
          x: a.bounds.x + (a.note.neume!.bounds.x),
        ),
    HorizontalEpisema e =>
      e
        ..performLayout(ctxt)
        ..bounds = e.bounds.copyWith(
          x: e.bounds.x + (e.note.neume!.bounds.x),
        ),
    Ictus i =>
      i
        ..performLayout(ctxt)
        ..bounds = i.bounds.copyWith(
          x: i.bounds.x + (i.note.neume!.bounds.x),
        ),
    Mora m =>
      m
        ..performLayout(ctxt)
        ..bounds = m.bounds.copyWith(
          x: m.bounds.x + (m.note.neume!.bounds.x),
        ),
    _ => null,
  };
}