translated method

ResolvedTextLine translated(
  1. DiagramPoint delta, {
  2. double? width,
  3. DiagramRect? regionBounds,
})

Moves the line by delta. Its regionBounds stay put unless replaced, since region-relative placement also uses this to offset lines.

Implementation

ResolvedTextLine translated(
  DiagramPoint delta, {
  double? width,
  DiagramRect? regionBounds,
}) => ResolvedTextLine(
  blockId: blockId,
  startOffset: startOffset,
  endOffset: endOffset,
  bounds: DiagramRect.fromLTWH(
    bounds.left + delta.x,
    bounds.top + delta.y,
    width ?? bounds.width,
    bounds.height,
  ),
  contentBounds: contentBounds.translate(delta),
  intrinsicWidth: intrinsicWidth,
  fontSize: fontSize,
  baseline: baseline,
  regionBounds: regionBounds ?? this.regionBounds,
  text: text,
  runs: runs,
  foreground: foreground,
  defaultFontSize: defaultFontSize,
  fontFamilies: fontFamilies,
  marker: marker,
  resolvedMarker: resolvedMarker?.translate(delta),
  geometry: geometry,
  role: role,
  overflow: overflow,
  alignment: alignment,
  direction: direction,
);