MCPcopy Index your code
hub / github.com/simstudioai/sim / applyBorder

Function applyBorder

apps/sim/lib/pptx-renderer/renderer/table-renderer.ts:587–608  ·  view source on GitHub ↗

* Apply a single border to a element from a line node.

(
  td: HTMLElement,
  tcPr: SafeXmlNode,
  lineName: string,
  cssProp: 'borderTop' | 'borderBottom' | 'borderLeft' | 'borderRight',
  ctx: RenderContext
)

Source from the content-addressed store, hash-verified

585 * Apply a single border to a <td> element from a line node.
586 */
587function applyBorder(
588 td: HTMLElement,
589 tcPr: SafeXmlNode,
590 lineName: string,
591 cssProp: 'borderTop' | 'borderBottom' | 'borderLeft' | 'borderRight',
592 ctx: RenderContext
593): void {
594 const ln = tcPr.child(lineName)
595 if (!ln.exists()) return
596
597 // Check for noFill — explicitly clear any border set by table style
598 const noFill = ln.child('noFill')
599 if (noFill.exists()) {
600 td.style[cssProp] = 'none'
601 return
602 }
603
604 const style = resolveLineStyle(ln, ctx)
605 if (style.width > 0 && style.color !== 'transparent') {
606 td.style[cssProp] = `${Math.max(style.width, 0.5)}px ${style.dash} ${style.color}`
607 }
608}

Callers 1

applyCellPropertiesFunction · 0.85

Calls 3

resolveLineStyleFunction · 0.90
childMethod · 0.80
existsMethod · 0.80

Tested by

no test coverage detected