Skip to content

bug: 最后一行最后一列单元格边框未渲染 #3

@x412773090

Description

@x412773090

当cell方法返回空字符串, 且未使用merges与borders方法时, 最后一个单元格边框未渲染

// 测试代码
TableRenderer.create('#app', 1400, 800)
  .scale(1)
  .bgcolor('#fff')
  .colHeader({
    height: 50,
    rows: 2,
    merges: ['A1:C1', 'D1:D2'],
    cellRenderer: (canvas, { x, y, width, height }) => {
      canvas
        .prop({ fillStyle: '#0069c2' })
        .beginPath()
        .moveTo(width - 12, 2)
        .lineTo(width - 2, 2)
        .lineTo(width - 7, 10)
        .closePath()
        .fill();
      return true;
    },
  })
  .borders([
  ])
  // .startRow(1)
  .rows(20)
  .cols(14)
  .styles([{ bold: true }, { bgcolor: '#ffc107' }])
  .col((index) => (index == 5 ? { width: 100, hide: true } : undefined))

  .scrollRows(2)
  .scrollCols(1)
  .cell((ri, ci) => '')
  .cellRenderer(cellRenderer)
  .render();

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions