给style加一个cellPadding:
- YssBhCellType.prototype.paint = function(ctx, value, x, y, w, h, style, options) {
- if (!ctx) {
- return;
- }
- style.cellPadding = "0 0 0 30";
- GC.Spread.Sheets.CellTypes.Text.prototype.paint.call(this, ctx, value, x , y, w, h, style, options);
- let backgroundImgStyle = new GC.Spread.Sheets.Style();
- backgroundImgStyle.backgroundImage = bgUrlMap[this._rowData.type];
- let bgPosition = {
- startX: 0,
- startY: 0,
- width: 24,
- height: 24,
- }
- bgPosition.startX = 8 * (this._rowData.level - 1) + 28;
- bgPosition.startY = Math.round((h - bgPosition.height) / 2);
- GC.Spread.Sheets.CellTypes.Text.prototype.paint.call(this, ctx, '', x + bgPosition.startX, y + bgPosition.startY, bgPosition.width, bgPosition.height, backgroundImgStyle, options);
- };
复制代码 |