@visactor/vtable 1.1.2 → 1.1.3-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/cjs/index.d.ts CHANGED
@@ -16,7 +16,7 @@ import { renderChart } from './scenegraph/graphic/contributions/chart-render-hel
16
16
  import { restoreMeasureText, setCustomAlphabetCharSet } from './scenegraph/utils/text-measure';
17
17
  export { getDataCellPath } from './tools/get-data-path';
18
18
  export * from './render/jsx';
19
- export declare const version = "1.1.2";
19
+ export declare const version = "1.1.3-alpha.0";
20
20
  export { TYPES, core, ListTable, ListTableConstructorOptions, PivotTable, PivotTableConstructorOptions, PivotChartConstructorOptions, PivotChart, IHeaderTreeDefine, IDimension, IIndicator, ITitleDefine, ICornerDefine, ColumnsDefine, ColumnDefine, LinkColumnDefine, ChartColumnDefine, ImageColumnDefine, SparklineColumnDefine, ProgressbarColumnDefine, TextColumnDefine, GroupColumnDefine, TextAlignType, TextBaselineType, themes, data, MousePointerCellEvent, getIcons, clearGlobal, register, DataStatistics, CustomLayout, updateCell, renderChart, graphicUtil, setCustomAlphabetCharSet, restoreMeasureText };
21
21
  declare function getIcons(): {
22
22
  [key: string]: TYPES.ColumnIconOption;
package/cjs/index.js CHANGED
@@ -142,6 +142,6 @@ Object.defineProperty(exports, "getDataCellPath", {
142
142
  get: function() {
143
143
  return get_data_path_1.getDataCellPath;
144
144
  }
145
- }), __exportStar(require("./render/jsx"), exports), exports.version = "1.1.2", exports.getIcons = getIcons,
146
- exports.clearGlobal = clearGlobal, TYPES.AggregationType;
145
+ }), __exportStar(require("./render/jsx"), exports), exports.version = "1.1.3-alpha.0",
146
+ exports.getIcons = getIcons, exports.clearGlobal = clearGlobal, TYPES.AggregationType;
147
147
  //# sourceMappingURL=index.js.map
package/cjs/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,uCAA4D;AA8F1D,4FA9FO,qBAAW,OA8FP;AA7Fb,IAAA,4BAAkB,GAAE,CAAC;AAErB,kDAAoC;AAqDlC,sBAAK;AApDP,6CAA+B;AAqD7B,oBAAI;AApDN,6CAA+B;AA4E7B,oBAAI;AA3EN,+CAAiC;AACjC,qDAAuC;AA+ErC,4BAAQ;AA9EV,iDAAmC;AAwEjC,wBAAM;AAvER,yEAA2D;AAiFzD,wCAAc;AA3DhB,2CAAwC;AA2BtC,0FA3BO,qBAAS,OA2BP;AA1BX,6CAA0C;AA4BxC,2FA5BO,uBAAU,OA4BP;AA3BZ,6CAA0C;AA8BxC,2FA9BO,uBAAU,OA8BP;AA5BZ,8DAAgD;AAwD9C,oCAAY;AAtDd,wEAAoE;AAuDlE,2FAvDO,wBAAU,OAuDP;AAtDZ,gGAAqF;AAuDnF,4FAvDO,iCAAW,OAuDP;AAtDb,kEAA+F;AAyD7F,mGAzDO,iCAAkB,OAyDP;AADlB,yGAxD2B,uCAAwB,OAwD3B;AAnD1B,uDAAwD;AAA/C,gHAAA,eAAe,OAAA;AACxB,+CAA6B;AAEhB,QAAA,OAAO,GAAG,OAAO,CAAC;AAqD/B,SAAS,QAAQ;IAGf,OAAO,KAAK,CAAC,GAAG,EAAE,CAAC;AACrB,CAAC;AArBC,4BAAQ;AAuBV,SAAS,WAAW;IAClB,QAAQ,CAAC,QAAQ,EAAE,CAAC;AAGtB,CAAC;AA1BC,kCAAW;AA2Bb,KAAK,CAAC,eAAe,CAAC","file":"index.js","sourcesContent":["/* eslint-disable sort-imports */\nimport { graphicUtil, registerForVrender } from './vrender';\nregisterForVrender();\n\nimport * as TYPES from './ts-types';\nimport * as core from './core';\nimport * as data from './data';\nimport * as icons from './icons';\nimport * as register from './register';\nimport * as themes from './themes';\nimport * as DataStatistics from './dataset/DataStatistics';\nimport type {\n ColumnDefine,\n ColumnsDefine,\n LinkColumnDefine,\n ChartColumnDefine,\n ImageColumnDefine,\n SparklineColumnDefine,\n ProgressbarColumnDefine,\n TextColumnDefine,\n GroupColumnDefine,\n ListTableConstructorOptions,\n PivotTableConstructorOptions,\n PivotChartConstructorOptions,\n IHeaderTreeDefine,\n IDimension,\n IIndicator,\n ITitleDefine,\n ICornerDefine,\n TextAlignType,\n TextBaselineType\n} from './ts-types';\nimport { ListTable } from './ListTable';\nimport { PivotTable } from './PivotTable';\nimport { PivotChart } from './PivotChart';\nimport type { MousePointerCellEvent } from './ts-types/events';\nimport * as CustomLayout from './render/layout';\n\nimport { updateCell } from './scenegraph/group-creater/cell-helper';\nimport { renderChart } from './scenegraph/graphic/contributions/chart-render-helper';\nimport { restoreMeasureText, setCustomAlphabetCharSet } from './scenegraph/utils/text-measure';\n\n// import { container, loadCanvasPicker } from '@src/vrender';\n// loadCanvasPicker(container);\n\nexport { getDataCellPath } from './tools/get-data-path';\nexport * from './render/jsx';\n\nexport const version = \"1.1.2\";\n/**\n * @namespace VTable\n */\nexport {\n /**\n * Types\n * @namespace VTable.TYPES\n */\n TYPES,\n core,\n ListTable,\n ListTableConstructorOptions,\n PivotTable,\n PivotTableConstructorOptions,\n PivotChartConstructorOptions,\n PivotChart,\n IHeaderTreeDefine,\n IDimension,\n IIndicator,\n ITitleDefine,\n ICornerDefine,\n ColumnsDefine,\n ColumnDefine,\n LinkColumnDefine,\n ChartColumnDefine,\n ImageColumnDefine,\n SparklineColumnDefine,\n ProgressbarColumnDefine,\n TextColumnDefine,\n GroupColumnDefine,\n TextAlignType,\n TextBaselineType,\n themes,\n data,\n MousePointerCellEvent,\n getIcons,\n clearGlobal,\n //plugin registers\n register,\n /**\n * 暂不推荐使用\n */\n DataStatistics,\n CustomLayout,\n updateCell,\n renderChart,\n graphicUtil,\n setCustomAlphabetCharSet,\n restoreMeasureText\n};\n\n/** @private */\nfunction getIcons(): {\n [key: string]: TYPES.ColumnIconOption;\n} {\n return icons.get();\n}\n/** 清理内部的全局变量 如注册的icon theme等 以及共享的header column类实例 */\nfunction clearGlobal() {\n register.clearAll();\n // headers.type.clearGlobal();\n // columns.type.clearGlobal();\n}\nTYPES.AggregationType;\n"]}
1
+ {"version":3,"sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,uCAA4D;AA8F1D,4FA9FO,qBAAW,OA8FP;AA7Fb,IAAA,4BAAkB,GAAE,CAAC;AAErB,kDAAoC;AAqDlC,sBAAK;AApDP,6CAA+B;AAqD7B,oBAAI;AApDN,6CAA+B;AA4E7B,oBAAI;AA3EN,+CAAiC;AACjC,qDAAuC;AA+ErC,4BAAQ;AA9EV,iDAAmC;AAwEjC,wBAAM;AAvER,yEAA2D;AAiFzD,wCAAc;AA3DhB,2CAAwC;AA2BtC,0FA3BO,qBAAS,OA2BP;AA1BX,6CAA0C;AA4BxC,2FA5BO,uBAAU,OA4BP;AA3BZ,6CAA0C;AA8BxC,2FA9BO,uBAAU,OA8BP;AA5BZ,8DAAgD;AAwD9C,oCAAY;AAtDd,wEAAoE;AAuDlE,2FAvDO,wBAAU,OAuDP;AAtDZ,gGAAqF;AAuDnF,4FAvDO,iCAAW,OAuDP;AAtDb,kEAA+F;AAyD7F,mGAzDO,iCAAkB,OAyDP;AADlB,yGAxD2B,uCAAwB,OAwD3B;AAnD1B,uDAAwD;AAA/C,gHAAA,eAAe,OAAA;AACxB,+CAA6B;AAEhB,QAAA,OAAO,GAAG,eAAe,CAAC;AAqDvC,SAAS,QAAQ;IAGf,OAAO,KAAK,CAAC,GAAG,EAAE,CAAC;AACrB,CAAC;AArBC,4BAAQ;AAuBV,SAAS,WAAW;IAClB,QAAQ,CAAC,QAAQ,EAAE,CAAC;AAGtB,CAAC;AA1BC,kCAAW;AA2Bb,KAAK,CAAC,eAAe,CAAC","file":"index.js","sourcesContent":["/* eslint-disable sort-imports */\nimport { graphicUtil, registerForVrender } from './vrender';\nregisterForVrender();\n\nimport * as TYPES from './ts-types';\nimport * as core from './core';\nimport * as data from './data';\nimport * as icons from './icons';\nimport * as register from './register';\nimport * as themes from './themes';\nimport * as DataStatistics from './dataset/DataStatistics';\nimport type {\n ColumnDefine,\n ColumnsDefine,\n LinkColumnDefine,\n ChartColumnDefine,\n ImageColumnDefine,\n SparklineColumnDefine,\n ProgressbarColumnDefine,\n TextColumnDefine,\n GroupColumnDefine,\n ListTableConstructorOptions,\n PivotTableConstructorOptions,\n PivotChartConstructorOptions,\n IHeaderTreeDefine,\n IDimension,\n IIndicator,\n ITitleDefine,\n ICornerDefine,\n TextAlignType,\n TextBaselineType\n} from './ts-types';\nimport { ListTable } from './ListTable';\nimport { PivotTable } from './PivotTable';\nimport { PivotChart } from './PivotChart';\nimport type { MousePointerCellEvent } from './ts-types/events';\nimport * as CustomLayout from './render/layout';\n\nimport { updateCell } from './scenegraph/group-creater/cell-helper';\nimport { renderChart } from './scenegraph/graphic/contributions/chart-render-helper';\nimport { restoreMeasureText, setCustomAlphabetCharSet } from './scenegraph/utils/text-measure';\n\n// import { container, loadCanvasPicker } from '@src/vrender';\n// loadCanvasPicker(container);\n\nexport { getDataCellPath } from './tools/get-data-path';\nexport * from './render/jsx';\n\nexport const version = \"1.1.3-alpha.0\";\n/**\n * @namespace VTable\n */\nexport {\n /**\n * Types\n * @namespace VTable.TYPES\n */\n TYPES,\n core,\n ListTable,\n ListTableConstructorOptions,\n PivotTable,\n PivotTableConstructorOptions,\n PivotChartConstructorOptions,\n PivotChart,\n IHeaderTreeDefine,\n IDimension,\n IIndicator,\n ITitleDefine,\n ICornerDefine,\n ColumnsDefine,\n ColumnDefine,\n LinkColumnDefine,\n ChartColumnDefine,\n ImageColumnDefine,\n SparklineColumnDefine,\n ProgressbarColumnDefine,\n TextColumnDefine,\n GroupColumnDefine,\n TextAlignType,\n TextBaselineType,\n themes,\n data,\n MousePointerCellEvent,\n getIcons,\n clearGlobal,\n //plugin registers\n register,\n /**\n * 暂不推荐使用\n */\n DataStatistics,\n CustomLayout,\n updateCell,\n renderChart,\n graphicUtil,\n setCustomAlphabetCharSet,\n restoreMeasureText\n};\n\n/** @private */\nfunction getIcons(): {\n [key: string]: TYPES.ColumnIconOption;\n} {\n return icons.get();\n}\n/** 清理内部的全局变量 如注册的icon theme等 以及共享的header column类实例 */\nfunction clearGlobal() {\n register.clearAll();\n // headers.type.clearGlobal();\n // columns.type.clearGlobal();\n}\nTYPES.AggregationType;\n"]}
@@ -32,10 +32,10 @@ let SplitGroupAfterRenderContribution = class {
32
32
  this.order = 0;
33
33
  }
34
34
  drawShape(group, context, x, y, doFill, doStroke, fVisible, sVisible, groupAttribute, drawContext, fillCb, strokeCb) {
35
- const {width: width = groupAttribute.width, height: height = groupAttribute.height, stroke: stroke = groupAttribute.stroke, strokeArrayColor: strokeArrayColor = groupAttribute.strokeArrayColor, strokeArrayWidth: strokeArrayWidth = groupAttribute.strokeArrayWidth, lineWidth: lineWidth = groupAttribute.lineWidth, strokeColor: strokeColor = groupAttribute.stroke} = group.attribute;
36
- if (!stroke || !Array.isArray(strokeArrayWidth) && 0 === lineWidth) return;
37
- let widthForStroke, heightForStroke;
38
- if (Array.isArray(strokeArrayColor) || Array.isArray(strokeArrayWidth)) {
35
+ var _a;
36
+ const {stroke: stroke = groupAttribute.stroke, strokeArrayColor: strokeArrayColor = groupAttribute.strokeArrayColor, strokeArrayWidth: strokeArrayWidth = groupAttribute.strokeArrayWidth, lineWidth: lineWidth = groupAttribute.lineWidth, strokeColor: strokeColor = groupAttribute.stroke} = group.attribute;
37
+ let widthForStroke, heightForStroke, {width: width = groupAttribute.width, height: height = groupAttribute.height} = group.attribute;
38
+ if (stroke && (Array.isArray(strokeArrayWidth) || 0 !== lineWidth) && (Array.isArray(strokeArrayColor) || Array.isArray(strokeArrayWidth))) {
39
39
  if ("number" == typeof lineWidth && 1 & lineWidth || Array.isArray(strokeArrayWidth) && strokeArrayWidth.some((width => 1 & width))) {
40
40
  const table = group.stage.table;
41
41
  if (!table) return;
@@ -46,6 +46,8 @@ let SplitGroupAfterRenderContribution = class {
46
46
  table && col === table.colCount - 1 && (deltaWidth = 1), table && row === table.rowCount - 1 && (deltaHeight = 1);
47
47
  }
48
48
  } else x = Math.floor(x) + .5, y = Math.floor(y) + .5;
49
+ (null === (_a = table.options.customConfig) || void 0 === _a ? void 0 : _a._disableColumnAndRowSizeRound) && (width = Math.round(width),
50
+ height = Math.round(height));
49
51
  const {width: widthFroDraw, height: heightFroDraw} = getCellSizeForDraw(group, Math.ceil(width + deltaWidth), Math.ceil(height + deltaHeight));
50
52
  widthForStroke = widthFroDraw, heightForStroke = heightFroDraw;
51
53
  } else widthForStroke = Math.ceil(width), heightForStroke = Math.ceil(height);
@@ -134,16 +136,18 @@ let DashGroupAfterRenderContribution = class {
134
136
  this.order = 0;
135
137
  }
136
138
  drawShape(group, context, x, y, doFill, doStroke, fVisible, sVisible, groupAttribute, drawContext, fillCb, strokeCb) {
137
- var _a, _b, _c, _d, _e;
139
+ var _a, _b, _c, _d, _e, _f;
138
140
  const {lineDash: lineDash = groupAttribute.lineDash, stroke: stroke = groupAttribute.stroke, strokeArrayColor: strokeArrayColor = groupAttribute.strokeArrayColor, strokeArrayWidth: strokeArrayWidth = groupAttribute.strokeArrayWidth, lineWidth: lineWidth = groupAttribute.lineWidth} = group.attribute;
139
141
  if (!stroke || !(Array.isArray(lineDash) && lineDash.length && (null === (_a = lineDash[0]) || void 0 === _a ? void 0 : _a.length)) || Array.isArray(strokeArrayColor) || Array.isArray(strokeArrayWidth)) return;
142
+ const table = group.stage.table;
143
+ if (!table) return;
140
144
  const splitLineDash = (0, vutils_1.isArray)(lineDash[0]) ? getQuadLineDash(lineDash) : [ lineDash, lineDash, lineDash, lineDash ];
141
145
  let widthForStroke, heightForStroke, {width: width = groupAttribute.width, height: height = groupAttribute.height} = group.attribute;
142
- if (width = Math.ceil(width), height = Math.ceil(height), 1 & lineWidth) {
143
- const table = group.stage.table;
144
- if (!table) return;
146
+ if ((null === (_b = table.options.customConfig) || void 0 === _b ? void 0 : _b._disableColumnAndRowSizeRound) ? (width = Math.round(width),
147
+ height = Math.round(height)) : (width = Math.ceil(width), height = Math.ceil(height)),
148
+ 1 & lineWidth) {
145
149
  let deltaWidth = 0, deltaHeight = 0;
146
- if ("bottom-right" === (null == table ? void 0 : table.theme.cellBorderClipDirection)) {
150
+ if ("bottom-right" === table.theme.cellBorderClipDirection) {
147
151
  if (x = Math.floor(x) - .5, y = Math.floor(y) - .5, "cell" === group.role) {
148
152
  const col = group.col, row = group.row;
149
153
  table && col === table.colCount - 1 && (deltaWidth = 1), table && row === table.rowCount - 1 && (deltaHeight = 1);
@@ -154,13 +158,13 @@ let DashGroupAfterRenderContribution = class {
154
158
  } else widthForStroke = Math.ceil(width), heightForStroke = Math.ceil(height);
155
159
  context.setStrokeStyle(group, group.attribute, x, y, groupAttribute), context.beginPath(),
156
160
  context.moveTo(x, y), context.lineTo(x + widthForStroke, y), context.lineDashOffset = context.currentMatrix.e / context.currentMatrix.a,
157
- context.setLineDash(null !== (_b = splitLineDash[0]) && void 0 !== _b ? _b : []),
161
+ context.setLineDash(null !== (_c = splitLineDash[0]) && void 0 !== _c ? _c : []),
158
162
  context.stroke(), context.beginPath(), context.moveTo(x + widthForStroke, y), context.lineTo(x + widthForStroke, y + heightForStroke),
159
- context.lineDashOffset = context.currentMatrix.f / context.currentMatrix.d, context.setLineDash(null !== (_c = splitLineDash[1]) && void 0 !== _c ? _c : []),
163
+ context.lineDashOffset = context.currentMatrix.f / context.currentMatrix.d, context.setLineDash(null !== (_d = splitLineDash[1]) && void 0 !== _d ? _d : []),
160
164
  context.stroke(), context.beginPath(), context.moveTo(x, y + heightForStroke), context.lineTo(x + widthForStroke, y + heightForStroke),
161
- context.lineDashOffset = context.currentMatrix.e / context.currentMatrix.a, context.setLineDash(null !== (_d = splitLineDash[2]) && void 0 !== _d ? _d : []),
165
+ context.lineDashOffset = context.currentMatrix.e / context.currentMatrix.a, context.setLineDash(null !== (_e = splitLineDash[2]) && void 0 !== _e ? _e : []),
162
166
  context.stroke(), context.beginPath(), context.moveTo(x, y), context.lineTo(x, y + heightForStroke),
163
- context.lineDashOffset = context.currentMatrix.f / context.currentMatrix.d, context.setLineDash(null !== (_e = splitLineDash[3]) && void 0 !== _e ? _e : []),
167
+ context.lineDashOffset = context.currentMatrix.f / context.currentMatrix.d, context.setLineDash(null !== (_f = splitLineDash[3]) && void 0 !== _f ? _f : []),
164
168
  context.stroke(), context.lineDashOffset = 0, context.setLineDash([]);
165
169
  }
166
170
  };
@@ -188,12 +192,16 @@ let AdjustPosGroupAfterRenderContribution = class {
188
192
  this.order = 0;
189
193
  }
190
194
  drawShape(group, context, x, y, doFill, doStroke, fVisible, sVisible, groupAttribute, drawContext, fillCb, strokeCb) {
191
- const {lineWidth: lineWidth = groupAttribute.lineWidth, stroke: stroke = groupAttribute.stroke, lineDash: lineDash = groupAttribute.lineDash, strokeArrayWidth: strokeArrayWidth = groupAttribute.strokeArrayWidth, strokeArrayColor: strokeArrayColor = groupAttribute.strokeArrayColor, notAdjustPos: notAdjustPos, cornerRadius: cornerRadius = groupAttribute.cornerRadius} = group.attribute, {width: width = groupAttribute.width, height: height = groupAttribute.height} = group.attribute;
195
+ var _a;
196
+ const {lineWidth: lineWidth = groupAttribute.lineWidth, stroke: stroke = groupAttribute.stroke, lineDash: lineDash = groupAttribute.lineDash, strokeArrayWidth: strokeArrayWidth = groupAttribute.strokeArrayWidth, strokeArrayColor: strokeArrayColor = groupAttribute.strokeArrayColor, notAdjustPos: notAdjustPos, cornerRadius: cornerRadius = groupAttribute.cornerRadius} = group.attribute;
197
+ let {width: width = groupAttribute.width, height: height = groupAttribute.height} = group.attribute;
192
198
  if (!0 !== notAdjustPos && stroke && Array.isArray(lineDash) && !lineDash.length && !Array.isArray(strokeArrayColor) && !Array.isArray(strokeArrayWidth) && 1 & lineWidth) {
193
- const {width: widthFroDraw, height: heightFroDraw} = getCellSizeForDraw(group, Math.ceil(width), Math.ceil(height));
194
- context.beginPath();
195
199
  const table = group.stage.table;
196
200
  if (!table) return;
201
+ (null === (_a = table.options.customConfig) || void 0 === _a ? void 0 : _a._disableColumnAndRowSizeRound) && (width = Math.round(width),
202
+ height = Math.round(height));
203
+ const {width: widthFroDraw, height: heightFroDraw} = getCellSizeForDraw(group, Math.ceil(width), Math.ceil(height));
204
+ context.beginPath();
197
205
  let deltaWidth = 0, deltaHeight = 0;
198
206
  if ("bottom-right" === (null == table ? void 0 : table.theme.cellBorderClipDirection)) {
199
207
  if (x = Math.floor(x) - .5, y = Math.floor(y) - .5, "cell" === group.role) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/scenegraph/graphic/contributions/group-contribution-render.ts"],"names":[],"mappings":";;;;;;;;;AAWA,gDAA4F;AAE5F,sEAAuE;AAGvE,+DAA8D;AAC9D,gDAAqD;AACrD,6CAA2C;AAOpC,IAAM,kCAAkC,GAAxC,MAAM,kCAAkC;IAAxC;QACL,SAAI,GAA+B,oCAA0B,CAAC,gBAAgB,CAAC;QAC/E,aAAQ,GAAG,IAAI,CAAC;QAChB,UAAK,GAAG,CAAC,CAAC;IAmEZ,CAAC;IAlEC,SAAS,CACP,KAAa,EACb,OAAmB,EACnB,CAAS,EACT,CAAS,EACT,MAAe,EACf,QAAiB,EACjB,QAAiB,EACjB,QAAiB,EACjB,cAAgD,EAChD,WAAyB,EACzB,MAIY,EACZ,QAIY,EACZ,cAAuD;QAEvD,MAAM,EACJ,MAAM,GAAG,cAAc,CAAC,MAAM,EAC9B,gBAAgB,GAAI,cAAsB,CAAC,gBAAgB,EAC3D,gBAAgB,GAAI,cAAsB,CAAC,gBAAgB,EAK5D,GAAG,KAAK,CAAC,SAAgB,CAAC;QAE3B,IAAI,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,gBAAgB,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,EAAE;YAClF,cAAc,CAAC,QAAQ,GAAG,KAAK,CAAC;SACjC;IA8BH,CAAC;CACF,CAAA;AAtEY,kCAAkC;IAD9C,IAAA,oBAAU,GAAE;GACA,kCAAkC,CAsE9C;AA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GAAG,CAAC,EAAE;YACvC,MAAM,IAAI,CAAC,CAAC;SACb;aAAM,IAAI,KAAK,IAAI,GAAG,KAAK,KAAK,CAAC,cAAc,GAAG,CAAC,IAAI,KAAK,CAAC,SAAS,EAAE;YACvE,MAAM,IAAI,CAAC,CAAC;SACb;KACF;SAAM,IAAI,KAAK,CAAC,IAAI,KAAK,eAAe,EAAE;QACzC,IAAI,KAAK,IAAI,KAAK,CAAC,UAAU,EAAE;YAC7B,KAAK,IAAI,CAAC,CAAC;SACZ;QACD,IAAI,KAAK,IAAI,KAAK,CAAC,SAAS,EAAE;YAC5B,MAAM,IAAI,CAAC,CAAC;SACb;KACF;IACD,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;AAC3B,CAAC;AAED,SAAS,eAAe,CAAC,QAAoB;IAC3C,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;QACzB,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;KAC7D;SAAM,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;QAChC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;KAC7D;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC","file":"group-contribution-render.js","sourcesContent":["import type {\n IGroup,\n IContext2d,\n IGroupGraphicAttribute,\n IMarkAttribute,\n IGraphicAttribute,\n IThemeAttribute,\n IGroupRenderContribution,\n IDrawContext,\n IRectGraphicAttribute\n} from './../../../vrender';\nimport { BaseRenderContributionTime, createRectPath, injectable } from './../../../vrender';\nimport type { Group } from '../group';\nimport { getCellHoverColor } from '../../../state/hover/is-cell-hover';\nimport type { BaseTableAPI } from '../../../ts-types/base-table';\nimport { getQuadProps } from '../../utils/padding';\nimport { getCellMergeInfo } from '../../utils/get-cell-merge';\nimport { InteractionState } from '../../../ts-types';\nimport { isArray } from '@visactor/vutils';\n\n// const highlightDash: number[] = [];\n\n// SplitGroupContribution处理分段渲染stroke\n// stroke/strokeArrayWidth/strokeArrayColor 为数组时调用\n@injectable()\nexport class SplitGroupBeforeRenderContribution implements IGroupRenderContribution {\n time: BaseRenderContributionTime = BaseRenderContributionTime.beforeFillStroke;\n useStyle = true;\n order = 0;\n drawShape(\n group: IGroup,\n context: IContext2d,\n x: number,\n y: number,\n doFill: boolean,\n doStroke: boolean,\n fVisible: boolean,\n sVisible: boolean,\n groupAttribute: Required<IGroupGraphicAttribute>,\n drawContext: IDrawContext,\n fillCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n strokeCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n doFillOrStroke?: { doFill: boolean; doStroke: boolean }\n ) {\n const {\n stroke = groupAttribute.stroke,\n strokeArrayWidth = (groupAttribute as any).strokeArrayWidth,\n strokeArrayColor = (groupAttribute as any).strokeArrayColor\n // highlightStroke = (groupAttribute as any).highlightStroke,\n // highlightStrokeArrayWidth = (groupAttribute as any).highlightStrokeArrayWidth,\n // width = groupAttribute.width,\n // height = groupAttribute.height,\n } = group.attribute as any;\n\n if (stroke && (Array.isArray(strokeArrayWidth) || Array.isArray(strokeArrayColor))) {\n doFillOrStroke.doStroke = false;\n }\n\n // if (highlightStroke) {\n // // 依据highlightStroke信息调整clip范围,以实现在单个单元格显示highlight border\n // let xDist = x;\n // let yDist = y;\n // let widthDist = width;\n // let heightDist = height;\n // if (highlightStroke[0] && highlightStrokeArrayWidth[0]) {\n // // top\n // yDist -= highlightStrokeArrayWidth[0] / 2;\n // heightDist += highlightStrokeArrayWidth[0] / 2;\n // }\n // if (highlightStroke[1] && highlightStrokeArrayWidth[1]) {\n // // right\n // widthDist += highlightStrokeArrayWidth[1] / 2;\n // }\n // if (highlightStroke[2] && highlightStrokeArrayWidth[2]) {\n // // bottom\n // heightDist += highlightStrokeArrayWidth[2] / 2;\n // }\n // if (highlightStroke[3] && highlightStrokeArrayWidth[3]) {\n // // left\n // xDist -= highlightStrokeArrayWidth[3] / 2;\n // widthDist += highlightStrokeArrayWidth[3] / 2;\n // }\n\n // context.beginPath();\n // context.rect(xDist, yDist, widthDist, heightDist);\n // }\n }\n}\n@injectable()\nexport class SplitGroupAfterRenderContribution implements IGroupRenderContribution {\n time: BaseRenderContributionTime = BaseRenderContributionTime.afterFillStroke;\n useStyle = true;\n order = 0;\n drawShape(\n group: IGroup,\n context: IContext2d,\n x: number,\n y: number,\n doFill: boolean,\n doStroke: boolean,\n fVisible: boolean,\n sVisible: boolean,\n groupAttribute: Required<IGroupGraphicAttribute>,\n drawContext: IDrawContext,\n fillCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n strokeCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean\n ) {\n const {\n width = groupAttribute.width,\n height = groupAttribute.height,\n // 基础border\n stroke = groupAttribute.stroke,\n strokeArrayColor = (groupAttribute as any).strokeArrayColor,\n strokeArrayWidth = (groupAttribute as any).strokeArrayWidth,\n\n lineWidth = groupAttribute.lineWidth,\n strokeColor = groupAttribute.stroke\n // // select & hover border\n // highlightStroke = (groupAttribute as any).highlightStroke,\n // highlightStrokeArrayColor = (groupAttribute as any).highlightStrokeArrayColor,\n // highlightStrokeArrayWidth = (groupAttribute as any).highlightStrokeArrayWidth,\n // highlightStrokeArrayPart = (groupAttribute as any).highlightStrokeArrayPart,\n } = group.attribute as any;\n\n // lineWidth === 0 不绘制\n if (!stroke || (!Array.isArray(strokeArrayWidth) && lineWidth === 0)) {\n return;\n }\n\n let widthForStroke;\n let heightForStroke;\n if (Array.isArray(strokeArrayColor) || Array.isArray(strokeArrayWidth)) {\n if (\n (typeof lineWidth === 'number' && lineWidth & 1) ||\n (Array.isArray(strokeArrayWidth) && strokeArrayWidth.some(width => width & 1))\n ) {\n const table = (group.stage as any).table as BaseTableAPI;\n if (!table) {\n return;\n }\n const bottomRight = table?.theme.cellBorderClipDirection === 'bottom-right';\n let deltaWidth = 0;\n let deltaHeight = 0;\n if (bottomRight) {\n x = Math.floor(x) - 0.5;\n y = Math.floor(y) - 0.5;\n if (group.role === 'cell') {\n const col = (group as any).col as number;\n const row = (group as any).row as number;\n if (table && col === table.colCount - 1) {\n deltaWidth = 1;\n }\n if (table && row === table.rowCount - 1) {\n deltaHeight = 1;\n }\n }\n } else {\n x = Math.floor(x) + 0.5;\n y = Math.floor(y) + 0.5;\n }\n\n const { width: widthFroDraw, height: heightFroDraw } = getCellSizeForDraw(\n group,\n Math.ceil(width + deltaWidth),\n Math.ceil(height + deltaHeight)\n );\n widthForStroke = widthFroDraw;\n heightForStroke = heightFroDraw;\n } else {\n widthForStroke = Math.ceil(width);\n heightForStroke = Math.ceil(height);\n }\n renderStroke(\n group,\n context,\n x,\n y,\n groupAttribute,\n stroke,\n strokeArrayWidth || lineWidth,\n strokeArrayColor || strokeColor,\n // Math.ceil(width),\n // Math.ceil(height)\n widthForStroke,\n heightForStroke\n );\n }\n }\n}\n\n/**\n * @description: 判断线宽是否需要分别渲染(线宽不同)\n * @param {number} widthArray\n * @return {*}\n */\nexport function getWidthInfo(widthArray: number[] | number) {\n if (!Array.isArray(widthArray)) {\n return {\n isSplitDraw: false,\n width: widthArray\n };\n }\n\n let temp;\n for (let i = 0; i < widthArray.length; i++) {\n const width = widthArray[i];\n if (width) {\n if (!temp) {\n temp = width;\n } else if (width !== temp) {\n return {\n isSplitDraw: true\n };\n }\n }\n }\n\n return {\n isSplitDraw: false,\n width: temp\n };\n}\n\nexport function renderStroke(\n group: IGroup,\n context: IContext2d,\n x: number,\n y: number,\n groupAttribute: Required<IGroupGraphicAttribute> | Required<IRectGraphicAttribute>,\n stroke: boolean | [boolean, boolean, boolean, boolean],\n strokeArrayWidth: [number, number, number, number] | undefined,\n strokeArrayColor: [string, string, string, string] | undefined,\n width: number,\n height: number,\n isHighlight?: boolean,\n part?: ([number, number] | undefined)[]\n) {\n const widthInfo = getWidthInfo(strokeArrayWidth);\n const isWidthNumber = !Array.isArray(strokeArrayWidth);\n const isStrokeTrue = !Array.isArray(stroke);\n // 渲染部分线段,part: [[0, 0.5], undifined, undifined, undifined]\n // 同样上右下左,范围0-1,[0, 0.5]即只渲染前一半\n const isPart = Array.isArray(part);\n const isSplitDraw = Array.isArray(strokeArrayColor) || widthInfo.isSplitDraw;\n\n context.setStrokeStyle(group, group.attribute, x, y, groupAttribute);\n // if (isHighlight) {\n // context.setLineDash(highlightDash);\n // context.lineCap = 'butt';\n // }\n\n const { lineDash = groupAttribute.lineDash } = group.attribute as any;\n // const lineDash = context.getLineDash();\n let isDash = false;\n if (lineDash.length && lineDash.some((dash: number[] | null) => Array.isArray(dash))) {\n isDash = true;\n }\n // 单独处理每条边界,目前不考虑圆角\n context.beginPath();\n context.moveTo(x, y);\n\n // top\n if ((isStrokeTrue || stroke[0]) && (isWidthNumber || strokeArrayWidth[0])) {\n // context.lineTo(x + width, y);\n if (isPart && Array.isArray(part[0])) {\n context.moveTo(x + width * part[0][0], y);\n context.lineTo(x + width * (part[0][1] - part[0][0]), y);\n context.moveTo(x + width, y);\n } else {\n context.moveTo(x, y);\n context.lineTo(x + width, y);\n }\n if (isSplitDraw || isDash) {\n if (strokeArrayColor && strokeArrayColor[0]) {\n context.strokeStyle = strokeArrayColor[0];\n } else {\n context.strokeStyle = 'transparent';\n }\n if (!isWidthNumber) {\n context.lineWidth = strokeArrayWidth[0];\n }\n context.lineDashOffset = context.currentMatrix.e / context.currentMatrix.a;\n if (isDash) {\n context.setLineDash(lineDash[0] ?? []);\n }\n context.stroke();\n context.beginPath();\n context.moveTo(x + width, y);\n }\n } else {\n context.moveTo(x + width, y);\n }\n // right\n if ((isStrokeTrue || stroke[1]) && (isWidthNumber || strokeArrayWidth[1])) {\n // context.lineTo(x + width, y + height);\n if (isPart && Array.isArray(part[1])) {\n context.moveTo(x + width, y + height * part[1][0]);\n context.lineTo(x + width, y + height * (part[1][1] - part[1][0]));\n context.moveTo(x + width, y + height);\n } else {\n context.moveTo(x + width, y);\n context.lineTo(x + width, y + height);\n }\n if (isSplitDraw || isDash) {\n if (strokeArrayColor && strokeArrayColor[1]) {\n context.strokeStyle = strokeArrayColor[1];\n } else {\n context.strokeStyle = 'transparent';\n }\n if (!isWidthNumber) {\n context.lineWidth = strokeArrayWidth[1];\n }\n context.lineDashOffset = context.currentMatrix.f / context.currentMatrix.d;\n if (isDash) {\n context.setLineDash(lineDash[1] ?? []);\n }\n context.stroke();\n context.beginPath();\n context.moveTo(x + width, y + height);\n }\n } else {\n context.moveTo(x + width, y + height);\n }\n // bottom\n if ((isStrokeTrue || stroke[2]) && (isWidthNumber || strokeArrayWidth[2])) {\n // context.lineTo(x, y + height);\n if (isPart && Array.isArray(part[2])) {\n context.moveTo(x + width * part[2][0], y + height);\n context.lineTo(x + width * (part[2][1] - part[2][0]), y + height);\n context.moveTo(x, y + height);\n } else {\n context.moveTo(x, y + height);\n context.lineTo(x + width, y + height);\n }\n if (isSplitDraw || isDash) {\n if (strokeArrayColor && strokeArrayColor[2]) {\n context.strokeStyle = strokeArrayColor[2];\n } else {\n context.strokeStyle = 'transparent';\n }\n if (!isWidthNumber) {\n context.lineWidth = strokeArrayWidth[2];\n }\n context.lineDashOffset = context.currentMatrix.e / context.currentMatrix.a;\n if (isDash) {\n context.setLineDash(lineDash[2] ?? []);\n }\n context.stroke();\n context.beginPath();\n context.moveTo(x, y + height);\n }\n } else {\n context.moveTo(x, y + height);\n }\n // left\n if ((isStrokeTrue || stroke[3]) && (isWidthNumber || strokeArrayWidth[3])) {\n // context.lineTo(x, y);\n if (isPart && Array.isArray(part[3])) {\n context.moveTo(x, y + height * part[3][0]);\n context.lineTo(x, y + height * (part[3][1] - part[3][0]));\n context.moveTo(x, y);\n } else {\n context.moveTo(x, y);\n context.lineTo(x, y + height);\n }\n if (isSplitDraw || isDash) {\n if (strokeArrayColor && strokeArrayColor[3]) {\n context.strokeStyle = strokeArrayColor[3];\n } else {\n context.strokeStyle = 'transparent';\n }\n if (!isWidthNumber) {\n context.lineWidth = strokeArrayWidth[3];\n }\n context.lineDashOffset = context.currentMatrix.f / context.currentMatrix.d;\n if (isDash) {\n context.setLineDash(lineDash[3] ?? []);\n }\n context.stroke();\n context.beginPath();\n context.moveTo(x, y);\n }\n } else {\n context.moveTo(x, y);\n }\n\n if (!isSplitDraw && !isDash) {\n // context.strokeStyle = strokeArrayColor;\n if (!isWidthNumber && widthInfo.width) {\n context.lineWidth = widthInfo.width;\n }\n context.stroke();\n }\n context.lineDashOffset = 0;\n context.setLineDash([]);\n}\n\n// DashGroupContribution处理虚线边框对齐\n// lineDash 为非空数组时调用\n@injectable()\nexport class DashGroupBeforeRenderContribution implements IGroupRenderContribution {\n time: BaseRenderContributionTime = BaseRenderContributionTime.beforeFillStroke;\n useStyle = true;\n order = 0;\n drawShape(\n group: IGroup,\n context: IContext2d,\n x: number,\n y: number,\n doFill: boolean,\n doStroke: boolean,\n fVisible: boolean,\n sVisible: boolean,\n groupAttribute: Required<IGroupGraphicAttribute>,\n drawContext: IDrawContext,\n fillCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n strokeCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n doFillOrStroke?: { doFill: boolean; doStroke: boolean }\n ) {\n const {\n lineDash = groupAttribute.lineDash,\n stroke = groupAttribute.stroke,\n strokeArrayColor = (groupAttribute as any).strokeArrayColor,\n strokeArrayWidth = (groupAttribute as any).strokeArrayWidth\n } = group.attribute as any;\n\n if (\n stroke &&\n Array.isArray(lineDash) &&\n lineDash.length &&\n lineDash[0]?.length &&\n !Array.isArray(strokeArrayColor) &&\n !Array.isArray(strokeArrayWidth)\n ) {\n doFillOrStroke.doStroke = false;\n }\n }\n}\n@injectable()\nexport class DashGroupAfterRenderContribution implements IGroupRenderContribution {\n time: BaseRenderContributionTime = BaseRenderContributionTime.afterFillStroke;\n useStyle = true;\n order = 0;\n drawShape(\n group: IGroup,\n context: IContext2d,\n x: number,\n y: number,\n doFill: boolean,\n doStroke: boolean,\n fVisible: boolean,\n sVisible: boolean,\n groupAttribute: Required<IGroupGraphicAttribute>,\n drawContext: IDrawContext,\n fillCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n strokeCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean\n ) {\n const {\n lineDash = groupAttribute.lineDash,\n stroke = groupAttribute.stroke,\n strokeArrayColor = (groupAttribute as any).strokeArrayColor,\n strokeArrayWidth = (groupAttribute as any).strokeArrayWidth,\n lineWidth = groupAttribute.lineWidth\n } = group.attribute as any;\n\n if (\n !stroke ||\n !(Array.isArray(lineDash) && lineDash.length && lineDash[0]?.length) ||\n Array.isArray(strokeArrayColor) ||\n Array.isArray(strokeArrayWidth)\n ) {\n return;\n }\n\n // convert lineDash to number[][]\n const splitLineDash = isArray(lineDash[0]) ? getQuadLineDash(lineDash) : [lineDash, lineDash, lineDash, lineDash];\n\n // const { width = groupAttribute.width, height = groupAttribute.height } = group.attribute;\n let { width = groupAttribute.width, height = groupAttribute.height } = group.attribute;\n width = Math.ceil(width);\n height = Math.ceil(height);\n\n let widthForStroke;\n let heightForStroke;\n if (lineWidth & 1) {\n const table = (group.stage as any).table as BaseTableAPI;\n if (!table) {\n return;\n }\n const bottomRight = table?.theme.cellBorderClipDirection === 'bottom-right';\n let deltaWidth = 0;\n let deltaHeight = 0;\n if (bottomRight) {\n x = Math.floor(x) - 0.5;\n y = Math.floor(y) - 0.5;\n if (group.role === 'cell') {\n const col = (group as any).col as number;\n const row = (group as any).row as number;\n if (table && col === table.colCount - 1) {\n deltaWidth = 1;\n }\n if (table && row === table.rowCount - 1) {\n deltaHeight = 1;\n }\n }\n } else {\n x = Math.floor(x) + 0.5;\n y = Math.floor(y) + 0.5;\n }\n\n const { width: widthFroDraw, height: heightFroDraw } = getCellSizeForDraw(\n group,\n Math.ceil(width + deltaWidth),\n Math.ceil(height + deltaHeight)\n );\n widthForStroke = widthFroDraw;\n heightForStroke = heightFroDraw;\n } else {\n widthForStroke = Math.ceil(width);\n heightForStroke = Math.ceil(height);\n }\n context.setStrokeStyle(group, group.attribute, x, y, groupAttribute);\n // 分段设置lineDashOffset,实现虚线边框对齐\n // top\n context.beginPath();\n context.moveTo(x, y);\n context.lineTo(x + widthForStroke, y);\n context.lineDashOffset = context.currentMatrix.e / context.currentMatrix.a;\n context.setLineDash(splitLineDash[0] ?? []);\n context.stroke();\n\n // right\n context.beginPath();\n context.moveTo(x + widthForStroke, y);\n context.lineTo(x + widthForStroke, y + heightForStroke);\n context.lineDashOffset = context.currentMatrix.f / context.currentMatrix.d;\n context.setLineDash(splitLineDash[1] ?? []);\n context.stroke();\n\n // bottom\n context.beginPath();\n context.moveTo(x, y + heightForStroke);\n context.lineTo(x + widthForStroke, y + heightForStroke);\n context.lineDashOffset = context.currentMatrix.e / context.currentMatrix.a;\n context.setLineDash(splitLineDash[2] ?? []);\n context.stroke();\n\n // left\n context.beginPath();\n context.moveTo(x, y);\n context.lineTo(x, y + heightForStroke);\n context.lineDashOffset = context.currentMatrix.f / context.currentMatrix.d;\n context.setLineDash(splitLineDash[3] ?? []);\n context.stroke();\n\n context.lineDashOffset = 0;\n context.setLineDash([]);\n }\n}\n\n// AdjustPosGroupContribution处理线宽为奇数时stroke位置偏移0.5px\n// lineWidth 为奇数时调用\n@injectable()\nexport class AdjustPosGroupBeforeRenderContribution implements IGroupRenderContribution {\n time: BaseRenderContributionTime = BaseRenderContributionTime.beforeFillStroke;\n useStyle = true;\n order = 0;\n drawShape(\n group: IGroup,\n context: IContext2d,\n x: number,\n y: number,\n doFill: boolean,\n doStroke: boolean,\n fVisible: boolean,\n sVisible: boolean,\n groupAttribute: Required<IGroupGraphicAttribute>,\n drawContext: IDrawContext,\n fillCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n strokeCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n doFillOrStroke?: { doFill: boolean; doStroke: boolean }\n ) {\n const {\n lineWidth = groupAttribute.lineWidth,\n stroke = groupAttribute.stroke,\n lineDash = groupAttribute.lineDash,\n // width = groupAttribute.width,\n // height = groupAttribute.height,\n strokeArrayWidth = (groupAttribute as any).strokeArrayWidth,\n strokeArrayColor = (groupAttribute as any).strokeArrayColor,\n notAdjustPos\n } = group.attribute as any;\n\n if (\n notAdjustPos !== true && // 不需要调整位置\n stroke &&\n Array.isArray(lineDash) &&\n !lineDash.length && // 非虚线\n !Array.isArray(strokeArrayColor) &&\n !Array.isArray(strokeArrayWidth) &&\n lineWidth & 1 // 奇数线宽\n ) {\n doFillOrStroke.doStroke = false;\n }\n }\n}\n\n@injectable()\nexport class AdjustPosGroupAfterRenderContribution implements IGroupRenderContribution {\n time: BaseRenderContributionTime = BaseRenderContributionTime.afterFillStroke;\n useStyle = true;\n order = 0;\n drawShape(\n group: IGroup,\n context: IContext2d,\n x: number,\n y: number,\n doFill: boolean,\n doStroke: boolean,\n fVisible: boolean,\n sVisible: boolean,\n groupAttribute: Required<IGroupGraphicAttribute>,\n drawContext: IDrawContext,\n fillCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n strokeCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean\n ) {\n const {\n lineWidth = groupAttribute.lineWidth,\n stroke = groupAttribute.stroke,\n lineDash = groupAttribute.lineDash,\n strokeArrayWidth = (groupAttribute as any).strokeArrayWidth,\n strokeArrayColor = (groupAttribute as any).strokeArrayColor,\n notAdjustPos,\n cornerRadius = groupAttribute.cornerRadius\n } = group.attribute as any;\n\n const { width = groupAttribute.width, height = groupAttribute.height } = group.attribute;\n // width = Math.ceil(width);\n // height = Math.ceil(height);\n\n if (\n notAdjustPos !== true && // 不需要调整位置\n stroke &&\n Array.isArray(lineDash) &&\n !lineDash.length && // 非虚线\n !Array.isArray(strokeArrayColor) &&\n !Array.isArray(strokeArrayWidth) &&\n lineWidth & 1 // 奇数线宽\n ) {\n // if (group.role === 'cell') {\n // const table = (group.stage as any).table as BaseTableAPI;\n // let col = (group as any).col as number;\n // let row = (group as any).row as number;\n // const mergeInfo = getCellMergeInfo(table, col, row);\n // if (mergeInfo) {\n // col = mergeInfo.end.col;\n // row = mergeInfo.end.row;\n // }\n\n // if (table && col === table.colCount - 1) {\n // width -= 1;\n // } else if (table && col === table.frozenColCount - 1 && table.scrollLeft) {\n // width -= 1;\n // }\n // if (table && row === table.rowCount - 1) {\n // height -= 1;\n // } else if (table && row === table.frozenRowCount - 1 && table.scrollTop) {\n // height -= 1;\n // }\n // }\n const { width: widthFroDraw, height: heightFroDraw } = getCellSizeForDraw(\n group,\n Math.ceil(width),\n Math.ceil(height)\n );\n context.beginPath();\n const table = (group.stage as any).table as BaseTableAPI;\n if (!table) {\n return;\n }\n const bottomRight = table?.theme.cellBorderClipDirection === 'bottom-right';\n let deltaWidth = 0;\n let deltaHeight = 0;\n if (bottomRight) {\n x = Math.floor(x) - 0.5;\n y = Math.floor(y) - 0.5;\n if (group.role === 'cell') {\n const col = (group as any).col as number;\n const row = (group as any).row as number;\n if (table && col === table.colCount - 1) {\n deltaWidth = 1;\n }\n if (table && row === table.rowCount - 1) {\n deltaHeight = 1;\n }\n }\n } else {\n x = Math.floor(x) + 0.5;\n y = Math.floor(y) + 0.5;\n }\n\n if (cornerRadius) {\n // 测试后,cache对于重绘性能提升不大,但是在首屏有一定性能损耗,因此rect不再使用cache\n createRectPath(context, x, y, widthFroDraw + deltaWidth, heightFroDraw + deltaHeight, cornerRadius);\n } else {\n context.rect(x, y, widthFroDraw, heightFroDraw);\n }\n context.setStrokeStyle(group, group.attribute, x, y, groupAttribute);\n context.stroke();\n }\n }\n}\n\n@injectable()\nexport class AdjustColorGroupBeforeRenderContribution implements IGroupRenderContribution {\n time: BaseRenderContributionTime = BaseRenderContributionTime.beforeFillStroke;\n useStyle = true;\n order = 0;\n drawShape(\n group: IGroup,\n context: IContext2d,\n x: number,\n y: number,\n doFill: boolean,\n doStroke: boolean,\n fVisible: boolean,\n sVisible: boolean,\n groupAttribute: Required<IGroupGraphicAttribute>,\n drawContext: IDrawContext,\n fillCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n strokeCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n doFillOrStroke?: { doFill: boolean; doStroke: boolean }\n ) {\n // 处理hover颜色\n if ((group as Group).role === 'cell') {\n const table = (group.stage as any).table as BaseTableAPI;\n if (table && table.stateManager.interactionState !== InteractionState.scrolling) {\n const hoverColor = getCellHoverColor(group as Group, table);\n if (hoverColor) {\n (group.attribute as any)._vtableHoverFill = hoverColor;\n }\n }\n }\n }\n}\n\n@injectable()\nexport class AdjustColorGroupAfterRenderContribution implements IGroupRenderContribution {\n time: BaseRenderContributionTime = BaseRenderContributionTime.afterFillStroke;\n useStyle = true;\n order = 0;\n drawShape(\n group: IGroup,\n context: IContext2d,\n x: number,\n y: number,\n doFill: boolean,\n doStroke: boolean,\n fVisible: boolean,\n sVisible: boolean,\n groupAttribute: Required<IGroupGraphicAttribute>,\n drawContext: IDrawContext,\n fillCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n strokeCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean\n ) {\n // 处理hover颜色\n if ((group.attribute as any)._vtableHoverFill) {\n if (fillCb) {\n // do nothing\n // fillCb(context, group.attribute, groupAttribute);\n } else if (fVisible) {\n const oldColor = group.attribute.fill;\n // draw hover fill\n group.attribute.fill = (group.attribute as any)._vtableHoverFill as any;\n context.setCommonStyle(group, group.attribute, x, y, groupAttribute);\n context.fill();\n group.attribute.fill = oldColor;\n (group.attribute as any)._vtableHoverFill = undefined;\n }\n }\n }\n}\n\n@injectable()\nexport class ClipBodyGroupBeforeRenderContribution implements IGroupRenderContribution {\n time: BaseRenderContributionTime = BaseRenderContributionTime.beforeFillStroke;\n useStyle = true;\n order = 0;\n drawShape(\n group: IGroup,\n context: IContext2d,\n x: number,\n y: number,\n doFill: boolean,\n doStroke: boolean,\n fVisible: boolean,\n sVisible: boolean,\n groupAttribute: Required<IGroupGraphicAttribute>,\n drawContext: IDrawContext,\n fillCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n strokeCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n doFillOrStroke?: { doFill: boolean; doStroke: boolean }\n ) {\n const table = (group.stage as any).table as BaseTableAPI;\n if (!table) {\n return;\n }\n if ((group as Group).role === 'body') {\n const x = -(group.attribute.x ?? 0) + table.getFrozenColsWidth();\n const y = -(group.attribute.y ?? 0) + table.getFrozenRowsHeight();\n const width = group.parent.attribute.width - table.getFrozenColsWidth() - table.getRightFrozenColsWidth();\n const height = group.parent.attribute.height - table.getFrozenRowsHeight() - table.getBottomFrozenRowsHeight();\n context.beginPath();\n context.rect(x, y, width, height);\n } else if ((group as Group).role === 'row-header') {\n const x = 0;\n const y = -(group.attribute.y ?? 0) + table.getFrozenRowsHeight();\n const width = table.getFrozenColsWidth();\n const height = group.parent.attribute.height - table.getFrozenRowsHeight() - table.getBottomFrozenRowsHeight();\n context.beginPath();\n context.rect(x, y, width, height);\n } else if ((group as Group).role === 'col-header') {\n const x = -(group.attribute.x ?? 0) + table.getFrozenColsWidth();\n const y = 0;\n const width = group.parent.attribute.width - table.getFrozenColsWidth() - table.getRightFrozenColsWidth();\n const height = table.getFrozenRowsHeight();\n context.beginPath();\n context.rect(x, y, width, height);\n } else if ((group as Group).role === 'right-frozen') {\n const x = 0;\n const y = -(group.attribute.y ?? 0) + table.getFrozenRowsHeight();\n const width = table.getRightFrozenColsWidth();\n const height = group.parent.attribute.height - table.getFrozenRowsHeight() - table.getBottomFrozenRowsHeight();\n context.beginPath();\n context.rect(x, y, width, height);\n } else if ((group as Group).role === 'bottom-frozen') {\n const x = -(group.attribute.x ?? 0) + table.getFrozenColsWidth();\n const y = 0;\n const width = group.parent.attribute.width - table.getFrozenColsWidth() - table.getRightFrozenColsWidth();\n const height = table.getBottomFrozenRowsHeight();\n context.beginPath();\n context.rect(x, y, width, height);\n } else if ((group as Group).role === 'corner-header') {\n const x = 0;\n const y = 0;\n const width = table.getFrozenColsWidth();\n const height = table.getFrozenRowsHeight();\n context.beginPath();\n context.rect(x, y, width, height);\n } else if ((group as Group).role === 'corner-right-top-header') {\n const x = 0;\n const y = 0;\n const width = table.getRightFrozenColsWidth();\n const height = table.getFrozenRowsHeight();\n context.beginPath();\n context.rect(x, y, width, height);\n } else if ((group as Group).role === 'corner-right-bottom-header') {\n const x = 0;\n const y = 0;\n const width = table.getRightFrozenColsWidth();\n const height = table.getBottomFrozenRowsHeight();\n context.beginPath();\n context.rect(x, y, width, height);\n } else if ((group as Group).role === 'corner-left-bottom-header') {\n const x = 0;\n const y = 0;\n const width = table.getFrozenColsWidth();\n const height = table.getBottomFrozenRowsHeight();\n context.beginPath();\n context.rect(x, y, width, height);\n }\n }\n}\n@injectable()\nexport class ClipBodyGroupAfterRenderContribution implements IGroupRenderContribution {\n time: BaseRenderContributionTime = BaseRenderContributionTime.afterFillStroke;\n useStyle = true;\n order = 0;\n drawShape(\n group: IGroup,\n context: IContext2d,\n x: number,\n y: number,\n doFill: boolean,\n doStroke: boolean,\n fVisible: boolean,\n sVisible: boolean,\n groupAttribute: Required<IGroupGraphicAttribute>,\n drawContext: IDrawContext,\n fillCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n strokeCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean\n ) {\n // 处理hover颜色\n if ((group as Group).role === 'body') {\n }\n }\n}\n\nfunction getCellSizeForDraw(group: any, width: number, height: number) {\n const table = group.stage.table as BaseTableAPI;\n if (group.role === 'cell') {\n let col = group.col as number;\n let row = group.row as number;\n const mergeInfo = getCellMergeInfo(table, col, row);\n if (mergeInfo) {\n col = mergeInfo.end.col;\n row = mergeInfo.end.row;\n }\n\n if (table && col === table.colCount - 1) {\n width -= 1;\n } else if (table && col === table.frozenColCount - 1 && table.scrollLeft) {\n width -= 1;\n }\n if (table && row === table.rowCount - 1) {\n height -= 1;\n } else if (table && row === table.frozenRowCount - 1 && table.scrollTop) {\n height -= 1;\n }\n } else if (group.role === 'corner-frozen') {\n if (table && table.scrollLeft) {\n width -= 1;\n }\n if (table && table.scrollTop) {\n height -= 1;\n }\n }\n return { width, height };\n}\n\nfunction getQuadLineDash(lineDash: number[][]) {\n if (lineDash.length === 1) {\n return [lineDash[0], lineDash[0], lineDash[0], lineDash[0]];\n } else if (lineDash.length === 2) {\n return [lineDash[0], lineDash[1], lineDash[0], lineDash[1]];\n }\n // 不考虑三个数的情况,三个数是用户传错了\n return lineDash;\n}\n"]}
1
+ {"version":3,"sources":["../src/scenegraph/graphic/contributions/group-contribution-render.ts"],"names":[],"mappings":";;;;;;;;;AAWA,gDAA4F;AAE5F,sEAAuE;AAGvE,+DAA8D;AAC9D,gDAAqD;AACrD,6CAA2C;AAOpC,IAAM,kCAAkC,GAAxC,MAAM,kCAAkC;IAAxC;QACL,SAAI,GAA+B,oCAA0B,CAAC,gBAAgB,CAAC;QAC/E,aAAQ,GAAG,IAAI,CAAC;QAChB,UAAK,GAAG,CAAC,CAAC;IAmEZ,CAAC;IAlEC,SAAS,CACP,KAAa,EACb,OAAmB,EACnB,CAAS,EACT,CAAS,EACT,MAAe,EACf,QAAiB,EACjB,QAAiB,EACjB,QAAiB,EACjB,cAAgD,EAChD,WAAyB,EACzB,MAIY,EACZ,QAIY,EACZ,cAAuD;QAEvD,MAAM,EACJ,MAAM,GAAG,cAAc,CAAC,MAAM,EAC9B,gBAAgB,GAAI,cAAsB,CAAC,gBAAgB,EAC3D,gBAAgB,GAAI,cAAsB,CAAC,gBAAgB,EAK5D,GAAG,KAAK,CAAC,SAAgB,CAAC;QAE3B,IAAI,MAAM,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,gBAAgB,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,EAAE;YAClF,cAAc,CAAC,QAAQ,GAAG,KAAK,CAAC;SACjC;IA8BH,CAAC;CACF,CAAA;AAtEY,kCAAkC;IAD9C,IAAA,oBAAU,GAAE;GACA,kCAAkC,CAsE9C;AAtEY,gFAAkC;AAwExC,IAAM,iCAAiC,GAAvC,MAAM,iCAAiC;IAAvC;QACL,SAAI,GAA+B,oCAA0B,CAAC,eAAe,CA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SAAM,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE;QAChC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;KAC7D;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC","file":"group-contribution-render.js","sourcesContent":["import type {\n IGroup,\n IContext2d,\n IGroupGraphicAttribute,\n IMarkAttribute,\n IGraphicAttribute,\n IThemeAttribute,\n IGroupRenderContribution,\n IDrawContext,\n IRectGraphicAttribute\n} from './../../../vrender';\nimport { BaseRenderContributionTime, createRectPath, injectable } from './../../../vrender';\nimport type { Group } from '../group';\nimport { getCellHoverColor } from '../../../state/hover/is-cell-hover';\nimport type { BaseTableAPI } from '../../../ts-types/base-table';\nimport { getQuadProps } from '../../utils/padding';\nimport { getCellMergeInfo } from '../../utils/get-cell-merge';\nimport { InteractionState } from '../../../ts-types';\nimport { isArray } from '@visactor/vutils';\n\n// const highlightDash: number[] = [];\n\n// SplitGroupContribution处理分段渲染stroke\n// stroke/strokeArrayWidth/strokeArrayColor 为数组时调用\n@injectable()\nexport class SplitGroupBeforeRenderContribution implements IGroupRenderContribution {\n time: BaseRenderContributionTime = BaseRenderContributionTime.beforeFillStroke;\n useStyle = true;\n order = 0;\n drawShape(\n group: IGroup,\n context: IContext2d,\n x: number,\n y: number,\n doFill: boolean,\n doStroke: boolean,\n fVisible: boolean,\n sVisible: boolean,\n groupAttribute: Required<IGroupGraphicAttribute>,\n drawContext: IDrawContext,\n fillCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n strokeCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n doFillOrStroke?: { doFill: boolean; doStroke: boolean }\n ) {\n const {\n stroke = groupAttribute.stroke,\n strokeArrayWidth = (groupAttribute as any).strokeArrayWidth,\n strokeArrayColor = (groupAttribute as any).strokeArrayColor\n // highlightStroke = (groupAttribute as any).highlightStroke,\n // highlightStrokeArrayWidth = (groupAttribute as any).highlightStrokeArrayWidth,\n // width = groupAttribute.width,\n // height = groupAttribute.height,\n } = group.attribute as any;\n\n if (stroke && (Array.isArray(strokeArrayWidth) || Array.isArray(strokeArrayColor))) {\n doFillOrStroke.doStroke = false;\n }\n\n // if (highlightStroke) {\n // // 依据highlightStroke信息调整clip范围,以实现在单个单元格显示highlight border\n // let xDist = x;\n // let yDist = y;\n // let widthDist = width;\n // let heightDist = height;\n // if (highlightStroke[0] && highlightStrokeArrayWidth[0]) {\n // // top\n // yDist -= highlightStrokeArrayWidth[0] / 2;\n // heightDist += highlightStrokeArrayWidth[0] / 2;\n // }\n // if (highlightStroke[1] && highlightStrokeArrayWidth[1]) {\n // // right\n // widthDist += highlightStrokeArrayWidth[1] / 2;\n // }\n // if (highlightStroke[2] && highlightStrokeArrayWidth[2]) {\n // // bottom\n // heightDist += highlightStrokeArrayWidth[2] / 2;\n // }\n // if (highlightStroke[3] && highlightStrokeArrayWidth[3]) {\n // // left\n // xDist -= highlightStrokeArrayWidth[3] / 2;\n // widthDist += highlightStrokeArrayWidth[3] / 2;\n // }\n\n // context.beginPath();\n // context.rect(xDist, yDist, widthDist, heightDist);\n // }\n }\n}\n@injectable()\nexport class SplitGroupAfterRenderContribution implements IGroupRenderContribution {\n time: BaseRenderContributionTime = BaseRenderContributionTime.afterFillStroke;\n useStyle = true;\n order = 0;\n drawShape(\n group: IGroup,\n context: IContext2d,\n x: number,\n y: number,\n doFill: boolean,\n doStroke: boolean,\n fVisible: boolean,\n sVisible: boolean,\n groupAttribute: Required<IGroupGraphicAttribute>,\n drawContext: IDrawContext,\n fillCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n strokeCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean\n ) {\n const {\n // width = groupAttribute.width,\n // height = groupAttribute.height,\n // 基础border\n stroke = groupAttribute.stroke,\n strokeArrayColor = (groupAttribute as any).strokeArrayColor,\n strokeArrayWidth = (groupAttribute as any).strokeArrayWidth,\n\n lineWidth = groupAttribute.lineWidth,\n strokeColor = groupAttribute.stroke\n // // select & hover border\n // highlightStroke = (groupAttribute as any).highlightStroke,\n // highlightStrokeArrayColor = (groupAttribute as any).highlightStrokeArrayColor,\n // highlightStrokeArrayWidth = (groupAttribute as any).highlightStrokeArrayWidth,\n // highlightStrokeArrayPart = (groupAttribute as any).highlightStrokeArrayPart,\n } = group.attribute as any;\n let { width = groupAttribute.width, height = groupAttribute.height } = group.attribute;\n\n // lineWidth === 0 不绘制\n if (!stroke || (!Array.isArray(strokeArrayWidth) && lineWidth === 0)) {\n return;\n }\n\n let widthForStroke;\n let heightForStroke;\n if (Array.isArray(strokeArrayColor) || Array.isArray(strokeArrayWidth)) {\n if (\n (typeof lineWidth === 'number' && lineWidth & 1) ||\n (Array.isArray(strokeArrayWidth) && strokeArrayWidth.some(width => width & 1))\n ) {\n const table = (group.stage as any).table as BaseTableAPI;\n if (!table) {\n return;\n }\n const bottomRight = table?.theme.cellBorderClipDirection === 'bottom-right';\n let deltaWidth = 0;\n let deltaHeight = 0;\n if (bottomRight) {\n x = Math.floor(x) - 0.5;\n y = Math.floor(y) - 0.5;\n if (group.role === 'cell') {\n const col = (group as any).col as number;\n const row = (group as any).row as number;\n if (table && col === table.colCount - 1) {\n deltaWidth = 1;\n }\n if (table && row === table.rowCount - 1) {\n deltaHeight = 1;\n }\n }\n } else {\n x = Math.floor(x) + 0.5;\n y = Math.floor(y) + 0.5;\n }\n\n if (table.options.customConfig?._disableColumnAndRowSizeRound) {\n width = Math.round(width);\n height = Math.round(height);\n }\n const { width: widthFroDraw, height: heightFroDraw } = getCellSizeForDraw(\n group,\n Math.ceil(width + deltaWidth),\n Math.ceil(height + deltaHeight)\n );\n widthForStroke = widthFroDraw;\n heightForStroke = heightFroDraw;\n } else {\n widthForStroke = Math.ceil(width);\n heightForStroke = Math.ceil(height);\n }\n renderStroke(\n group,\n context,\n x,\n y,\n groupAttribute,\n stroke,\n strokeArrayWidth || lineWidth,\n strokeArrayColor || strokeColor,\n // Math.ceil(width),\n // Math.ceil(height)\n widthForStroke,\n heightForStroke\n );\n }\n }\n}\n\n/**\n * @description: 判断线宽是否需要分别渲染(线宽不同)\n * @param {number} widthArray\n * @return {*}\n */\nexport function getWidthInfo(widthArray: number[] | number) {\n if (!Array.isArray(widthArray)) {\n return {\n isSplitDraw: false,\n width: widthArray\n };\n }\n\n let temp;\n for (let i = 0; i < widthArray.length; i++) {\n const width = widthArray[i];\n if (width) {\n if (!temp) {\n temp = width;\n } else if (width !== temp) {\n return {\n isSplitDraw: true\n };\n }\n }\n }\n\n return {\n isSplitDraw: false,\n width: temp\n };\n}\n\nexport function renderStroke(\n group: IGroup,\n context: IContext2d,\n x: number,\n y: number,\n groupAttribute: Required<IGroupGraphicAttribute> | Required<IRectGraphicAttribute>,\n stroke: boolean | [boolean, boolean, boolean, boolean],\n strokeArrayWidth: [number, number, number, number] | undefined,\n strokeArrayColor: [string, string, string, string] | undefined,\n width: number,\n height: number,\n isHighlight?: boolean,\n part?: ([number, number] | undefined)[]\n) {\n const widthInfo = getWidthInfo(strokeArrayWidth);\n const isWidthNumber = !Array.isArray(strokeArrayWidth);\n const isStrokeTrue = !Array.isArray(stroke);\n // 渲染部分线段,part: [[0, 0.5], undifined, undifined, undifined]\n // 同样上右下左,范围0-1,[0, 0.5]即只渲染前一半\n const isPart = Array.isArray(part);\n const isSplitDraw = Array.isArray(strokeArrayColor) || widthInfo.isSplitDraw;\n\n context.setStrokeStyle(group, group.attribute, x, y, groupAttribute);\n // if (isHighlight) {\n // context.setLineDash(highlightDash);\n // context.lineCap = 'butt';\n // }\n\n const { lineDash = groupAttribute.lineDash } = group.attribute as any;\n // const lineDash = context.getLineDash();\n let isDash = false;\n if (lineDash.length && lineDash.some((dash: number[] | null) => Array.isArray(dash))) {\n isDash = true;\n }\n // 单独处理每条边界,目前不考虑圆角\n context.beginPath();\n context.moveTo(x, y);\n\n // top\n if ((isStrokeTrue || stroke[0]) && (isWidthNumber || strokeArrayWidth[0])) {\n // context.lineTo(x + width, y);\n if (isPart && Array.isArray(part[0])) {\n context.moveTo(x + width * part[0][0], y);\n context.lineTo(x + width * (part[0][1] - part[0][0]), y);\n context.moveTo(x + width, y);\n } else {\n context.moveTo(x, y);\n context.lineTo(x + width, y);\n }\n if (isSplitDraw || isDash) {\n if (strokeArrayColor && strokeArrayColor[0]) {\n context.strokeStyle = strokeArrayColor[0];\n } else {\n context.strokeStyle = 'transparent';\n }\n if (!isWidthNumber) {\n context.lineWidth = strokeArrayWidth[0];\n }\n context.lineDashOffset = context.currentMatrix.e / context.currentMatrix.a;\n if (isDash) {\n context.setLineDash(lineDash[0] ?? []);\n }\n context.stroke();\n context.beginPath();\n context.moveTo(x + width, y);\n }\n } else {\n context.moveTo(x + width, y);\n }\n // right\n if ((isStrokeTrue || stroke[1]) && (isWidthNumber || strokeArrayWidth[1])) {\n // context.lineTo(x + width, y + height);\n if (isPart && Array.isArray(part[1])) {\n context.moveTo(x + width, y + height * part[1][0]);\n context.lineTo(x + width, y + height * (part[1][1] - part[1][0]));\n context.moveTo(x + width, y + height);\n } else {\n context.moveTo(x + width, y);\n context.lineTo(x + width, y + height);\n }\n if (isSplitDraw || isDash) {\n if (strokeArrayColor && strokeArrayColor[1]) {\n context.strokeStyle = strokeArrayColor[1];\n } else {\n context.strokeStyle = 'transparent';\n }\n if (!isWidthNumber) {\n context.lineWidth = strokeArrayWidth[1];\n }\n context.lineDashOffset = context.currentMatrix.f / context.currentMatrix.d;\n if (isDash) {\n context.setLineDash(lineDash[1] ?? []);\n }\n context.stroke();\n context.beginPath();\n context.moveTo(x + width, y + height);\n }\n } else {\n context.moveTo(x + width, y + height);\n }\n // bottom\n if ((isStrokeTrue || stroke[2]) && (isWidthNumber || strokeArrayWidth[2])) {\n // context.lineTo(x, y + height);\n if (isPart && Array.isArray(part[2])) {\n context.moveTo(x + width * part[2][0], y + height);\n context.lineTo(x + width * (part[2][1] - part[2][0]), y + height);\n context.moveTo(x, y + height);\n } else {\n context.moveTo(x, y + height);\n context.lineTo(x + width, y + height);\n }\n if (isSplitDraw || isDash) {\n if (strokeArrayColor && strokeArrayColor[2]) {\n context.strokeStyle = strokeArrayColor[2];\n } else {\n context.strokeStyle = 'transparent';\n }\n if (!isWidthNumber) {\n context.lineWidth = strokeArrayWidth[2];\n }\n context.lineDashOffset = context.currentMatrix.e / context.currentMatrix.a;\n if (isDash) {\n context.setLineDash(lineDash[2] ?? []);\n }\n context.stroke();\n context.beginPath();\n context.moveTo(x, y + height);\n }\n } else {\n context.moveTo(x, y + height);\n }\n // left\n if ((isStrokeTrue || stroke[3]) && (isWidthNumber || strokeArrayWidth[3])) {\n // context.lineTo(x, y);\n if (isPart && Array.isArray(part[3])) {\n context.moveTo(x, y + height * part[3][0]);\n context.lineTo(x, y + height * (part[3][1] - part[3][0]));\n context.moveTo(x, y);\n } else {\n context.moveTo(x, y);\n context.lineTo(x, y + height);\n }\n if (isSplitDraw || isDash) {\n if (strokeArrayColor && strokeArrayColor[3]) {\n context.strokeStyle = strokeArrayColor[3];\n } else {\n context.strokeStyle = 'transparent';\n }\n if (!isWidthNumber) {\n context.lineWidth = strokeArrayWidth[3];\n }\n context.lineDashOffset = context.currentMatrix.f / context.currentMatrix.d;\n if (isDash) {\n context.setLineDash(lineDash[3] ?? []);\n }\n context.stroke();\n context.beginPath();\n context.moveTo(x, y);\n }\n } else {\n context.moveTo(x, y);\n }\n\n if (!isSplitDraw && !isDash) {\n // context.strokeStyle = strokeArrayColor;\n if (!isWidthNumber && widthInfo.width) {\n context.lineWidth = widthInfo.width;\n }\n context.stroke();\n }\n context.lineDashOffset = 0;\n context.setLineDash([]);\n}\n\n// DashGroupContribution处理虚线边框对齐\n// lineDash 为非空数组时调用\n@injectable()\nexport class DashGroupBeforeRenderContribution implements IGroupRenderContribution {\n time: BaseRenderContributionTime = BaseRenderContributionTime.beforeFillStroke;\n useStyle = true;\n order = 0;\n drawShape(\n group: IGroup,\n context: IContext2d,\n x: number,\n y: number,\n doFill: boolean,\n doStroke: boolean,\n fVisible: boolean,\n sVisible: boolean,\n groupAttribute: Required<IGroupGraphicAttribute>,\n drawContext: IDrawContext,\n fillCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n strokeCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n doFillOrStroke?: { doFill: boolean; doStroke: boolean }\n ) {\n const {\n lineDash = groupAttribute.lineDash,\n stroke = groupAttribute.stroke,\n strokeArrayColor = (groupAttribute as any).strokeArrayColor,\n strokeArrayWidth = (groupAttribute as any).strokeArrayWidth\n } = group.attribute as any;\n\n if (\n stroke &&\n Array.isArray(lineDash) &&\n lineDash.length &&\n lineDash[0]?.length &&\n !Array.isArray(strokeArrayColor) &&\n !Array.isArray(strokeArrayWidth)\n ) {\n doFillOrStroke.doStroke = false;\n }\n }\n}\n@injectable()\nexport class DashGroupAfterRenderContribution implements IGroupRenderContribution {\n time: BaseRenderContributionTime = BaseRenderContributionTime.afterFillStroke;\n useStyle = true;\n order = 0;\n drawShape(\n group: IGroup,\n context: IContext2d,\n x: number,\n y: number,\n doFill: boolean,\n doStroke: boolean,\n fVisible: boolean,\n sVisible: boolean,\n groupAttribute: Required<IGroupGraphicAttribute>,\n drawContext: IDrawContext,\n fillCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n strokeCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean\n ) {\n const {\n lineDash = groupAttribute.lineDash,\n stroke = groupAttribute.stroke,\n strokeArrayColor = (groupAttribute as any).strokeArrayColor,\n strokeArrayWidth = (groupAttribute as any).strokeArrayWidth,\n lineWidth = groupAttribute.lineWidth\n } = group.attribute as any;\n\n if (\n !stroke ||\n !(Array.isArray(lineDash) && lineDash.length && lineDash[0]?.length) ||\n Array.isArray(strokeArrayColor) ||\n Array.isArray(strokeArrayWidth)\n ) {\n return;\n }\n\n const table = (group.stage as any).table as BaseTableAPI;\n if (!table) {\n return;\n }\n\n // convert lineDash to number[][]\n const splitLineDash = isArray(lineDash[0]) ? getQuadLineDash(lineDash) : [lineDash, lineDash, lineDash, lineDash];\n\n // const { width = groupAttribute.width, height = groupAttribute.height } = group.attribute;\n let { width = groupAttribute.width, height = groupAttribute.height } = group.attribute;\n if (table.options.customConfig?._disableColumnAndRowSizeRound) {\n width = Math.round(width);\n height = Math.round(height);\n } else {\n width = Math.ceil(width);\n height = Math.ceil(height);\n }\n\n let widthForStroke;\n let heightForStroke;\n if (lineWidth & 1) {\n const bottomRight = table.theme.cellBorderClipDirection === 'bottom-right';\n let deltaWidth = 0;\n let deltaHeight = 0;\n if (bottomRight) {\n x = Math.floor(x) - 0.5;\n y = Math.floor(y) - 0.5;\n if (group.role === 'cell') {\n const col = (group as any).col as number;\n const row = (group as any).row as number;\n if (table && col === table.colCount - 1) {\n deltaWidth = 1;\n }\n if (table && row === table.rowCount - 1) {\n deltaHeight = 1;\n }\n }\n } else {\n x = Math.floor(x) + 0.5;\n y = Math.floor(y) + 0.5;\n }\n\n const { width: widthFroDraw, height: heightFroDraw } = getCellSizeForDraw(\n group,\n Math.ceil(width + deltaWidth),\n Math.ceil(height + deltaHeight)\n );\n widthForStroke = widthFroDraw;\n heightForStroke = heightFroDraw;\n } else {\n widthForStroke = Math.ceil(width);\n heightForStroke = Math.ceil(height);\n }\n context.setStrokeStyle(group, group.attribute, x, y, groupAttribute);\n // 分段设置lineDashOffset,实现虚线边框对齐\n // top\n context.beginPath();\n context.moveTo(x, y);\n context.lineTo(x + widthForStroke, y);\n context.lineDashOffset = context.currentMatrix.e / context.currentMatrix.a;\n context.setLineDash(splitLineDash[0] ?? []);\n context.stroke();\n\n // right\n context.beginPath();\n context.moveTo(x + widthForStroke, y);\n context.lineTo(x + widthForStroke, y + heightForStroke);\n context.lineDashOffset = context.currentMatrix.f / context.currentMatrix.d;\n context.setLineDash(splitLineDash[1] ?? []);\n context.stroke();\n\n // bottom\n context.beginPath();\n context.moveTo(x, y + heightForStroke);\n context.lineTo(x + widthForStroke, y + heightForStroke);\n context.lineDashOffset = context.currentMatrix.e / context.currentMatrix.a;\n context.setLineDash(splitLineDash[2] ?? []);\n context.stroke();\n\n // left\n context.beginPath();\n context.moveTo(x, y);\n context.lineTo(x, y + heightForStroke);\n context.lineDashOffset = context.currentMatrix.f / context.currentMatrix.d;\n context.setLineDash(splitLineDash[3] ?? []);\n context.stroke();\n\n context.lineDashOffset = 0;\n context.setLineDash([]);\n }\n}\n\n// AdjustPosGroupContribution处理线宽为奇数时stroke位置偏移0.5px\n// lineWidth 为奇数时调用\n@injectable()\nexport class AdjustPosGroupBeforeRenderContribution implements IGroupRenderContribution {\n time: BaseRenderContributionTime = BaseRenderContributionTime.beforeFillStroke;\n useStyle = true;\n order = 0;\n drawShape(\n group: IGroup,\n context: IContext2d,\n x: number,\n y: number,\n doFill: boolean,\n doStroke: boolean,\n fVisible: boolean,\n sVisible: boolean,\n groupAttribute: Required<IGroupGraphicAttribute>,\n drawContext: IDrawContext,\n fillCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n strokeCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n doFillOrStroke?: { doFill: boolean; doStroke: boolean }\n ) {\n const {\n lineWidth = groupAttribute.lineWidth,\n stroke = groupAttribute.stroke,\n lineDash = groupAttribute.lineDash,\n // width = groupAttribute.width,\n // height = groupAttribute.height,\n strokeArrayWidth = (groupAttribute as any).strokeArrayWidth,\n strokeArrayColor = (groupAttribute as any).strokeArrayColor,\n notAdjustPos\n } = group.attribute as any;\n\n if (\n notAdjustPos !== true && // 不需要调整位置\n stroke &&\n Array.isArray(lineDash) &&\n !lineDash.length && // 非虚线\n !Array.isArray(strokeArrayColor) &&\n !Array.isArray(strokeArrayWidth) &&\n lineWidth & 1 // 奇数线宽\n ) {\n doFillOrStroke.doStroke = false;\n }\n }\n}\n\n@injectable()\nexport class AdjustPosGroupAfterRenderContribution implements IGroupRenderContribution {\n time: BaseRenderContributionTime = BaseRenderContributionTime.afterFillStroke;\n useStyle = true;\n order = 0;\n drawShape(\n group: IGroup,\n context: IContext2d,\n x: number,\n y: number,\n doFill: boolean,\n doStroke: boolean,\n fVisible: boolean,\n sVisible: boolean,\n groupAttribute: Required<IGroupGraphicAttribute>,\n drawContext: IDrawContext,\n fillCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n strokeCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean\n ) {\n const {\n lineWidth = groupAttribute.lineWidth,\n stroke = groupAttribute.stroke,\n lineDash = groupAttribute.lineDash,\n strokeArrayWidth = (groupAttribute as any).strokeArrayWidth,\n strokeArrayColor = (groupAttribute as any).strokeArrayColor,\n notAdjustPos,\n cornerRadius = groupAttribute.cornerRadius\n } = group.attribute as any;\n\n let { width = groupAttribute.width, height = groupAttribute.height } = group.attribute;\n // width = Math.ceil(width);\n // height = Math.ceil(height);\n\n if (\n notAdjustPos !== true && // 不需要调整位置\n stroke &&\n Array.isArray(lineDash) &&\n !lineDash.length && // 非虚线\n !Array.isArray(strokeArrayColor) &&\n !Array.isArray(strokeArrayWidth) &&\n lineWidth & 1 // 奇数线宽\n ) {\n // if (group.role === 'cell') {\n // const table = (group.stage as any).table as BaseTableAPI;\n // let col = (group as any).col as number;\n // let row = (group as any).row as number;\n // const mergeInfo = getCellMergeInfo(table, col, row);\n // if (mergeInfo) {\n // col = mergeInfo.end.col;\n // row = mergeInfo.end.row;\n // }\n\n // if (table && col === table.colCount - 1) {\n // width -= 1;\n // } else if (table && col === table.frozenColCount - 1 && table.scrollLeft) {\n // width -= 1;\n // }\n // if (table && row === table.rowCount - 1) {\n // height -= 1;\n // } else if (table && row === table.frozenRowCount - 1 && table.scrollTop) {\n // height -= 1;\n // }\n // }\n\n const table = (group.stage as any).table as BaseTableAPI;\n if (!table) {\n return;\n }\n if (table.options.customConfig?._disableColumnAndRowSizeRound) {\n width = Math.round(width);\n height = Math.round(height);\n }\n const { width: widthFroDraw, height: heightFroDraw } = getCellSizeForDraw(\n group,\n Math.ceil(width),\n Math.ceil(height)\n );\n context.beginPath();\n\n const bottomRight = table?.theme.cellBorderClipDirection === 'bottom-right';\n let deltaWidth = 0;\n let deltaHeight = 0;\n if (bottomRight) {\n x = Math.floor(x) - 0.5;\n y = Math.floor(y) - 0.5;\n if (group.role === 'cell') {\n const col = (group as any).col as number;\n const row = (group as any).row as number;\n if (table && col === table.colCount - 1) {\n deltaWidth = 1;\n }\n if (table && row === table.rowCount - 1) {\n deltaHeight = 1;\n }\n }\n } else {\n x = Math.floor(x) + 0.5;\n y = Math.floor(y) + 0.5;\n }\n\n if (cornerRadius) {\n // 测试后,cache对于重绘性能提升不大,但是在首屏有一定性能损耗,因此rect不再使用cache\n createRectPath(context, x, y, widthFroDraw + deltaWidth, heightFroDraw + deltaHeight, cornerRadius);\n } else {\n context.rect(x, y, widthFroDraw, heightFroDraw);\n }\n context.setStrokeStyle(group, group.attribute, x, y, groupAttribute);\n context.stroke();\n }\n }\n}\n\n@injectable()\nexport class AdjustColorGroupBeforeRenderContribution implements IGroupRenderContribution {\n time: BaseRenderContributionTime = BaseRenderContributionTime.beforeFillStroke;\n useStyle = true;\n order = 0;\n drawShape(\n group: IGroup,\n context: IContext2d,\n x: number,\n y: number,\n doFill: boolean,\n doStroke: boolean,\n fVisible: boolean,\n sVisible: boolean,\n groupAttribute: Required<IGroupGraphicAttribute>,\n drawContext: IDrawContext,\n fillCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n strokeCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n doFillOrStroke?: { doFill: boolean; doStroke: boolean }\n ) {\n // 处理hover颜色\n if ((group as Group).role === 'cell') {\n const table = (group.stage as any).table as BaseTableAPI;\n if (table && table.stateManager.interactionState !== InteractionState.scrolling) {\n const hoverColor = getCellHoverColor(group as Group, table);\n if (hoverColor) {\n (group.attribute as any)._vtableHoverFill = hoverColor;\n }\n }\n }\n }\n}\n\n@injectable()\nexport class AdjustColorGroupAfterRenderContribution implements IGroupRenderContribution {\n time: BaseRenderContributionTime = BaseRenderContributionTime.afterFillStroke;\n useStyle = true;\n order = 0;\n drawShape(\n group: IGroup,\n context: IContext2d,\n x: number,\n y: number,\n doFill: boolean,\n doStroke: boolean,\n fVisible: boolean,\n sVisible: boolean,\n groupAttribute: Required<IGroupGraphicAttribute>,\n drawContext: IDrawContext,\n fillCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n strokeCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean\n ) {\n // 处理hover颜色\n if ((group.attribute as any)._vtableHoverFill) {\n if (fillCb) {\n // do nothing\n // fillCb(context, group.attribute, groupAttribute);\n } else if (fVisible) {\n const oldColor = group.attribute.fill;\n // draw hover fill\n group.attribute.fill = (group.attribute as any)._vtableHoverFill as any;\n context.setCommonStyle(group, group.attribute, x, y, groupAttribute);\n context.fill();\n group.attribute.fill = oldColor;\n (group.attribute as any)._vtableHoverFill = undefined;\n }\n }\n }\n}\n\n@injectable()\nexport class ClipBodyGroupBeforeRenderContribution implements IGroupRenderContribution {\n time: BaseRenderContributionTime = BaseRenderContributionTime.beforeFillStroke;\n useStyle = true;\n order = 0;\n drawShape(\n group: IGroup,\n context: IContext2d,\n x: number,\n y: number,\n doFill: boolean,\n doStroke: boolean,\n fVisible: boolean,\n sVisible: boolean,\n groupAttribute: Required<IGroupGraphicAttribute>,\n drawContext: IDrawContext,\n fillCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n strokeCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n doFillOrStroke?: { doFill: boolean; doStroke: boolean }\n ) {\n const table = (group.stage as any).table as BaseTableAPI;\n if (!table) {\n return;\n }\n if ((group as Group).role === 'body') {\n const x = -(group.attribute.x ?? 0) + table.getFrozenColsWidth();\n const y = -(group.attribute.y ?? 0) + table.getFrozenRowsHeight();\n const width = group.parent.attribute.width - table.getFrozenColsWidth() - table.getRightFrozenColsWidth();\n const height = group.parent.attribute.height - table.getFrozenRowsHeight() - table.getBottomFrozenRowsHeight();\n context.beginPath();\n context.rect(x, y, width, height);\n } else if ((group as Group).role === 'row-header') {\n const x = 0;\n const y = -(group.attribute.y ?? 0) + table.getFrozenRowsHeight();\n const width = table.getFrozenColsWidth();\n const height = group.parent.attribute.height - table.getFrozenRowsHeight() - table.getBottomFrozenRowsHeight();\n context.beginPath();\n context.rect(x, y, width, height);\n } else if ((group as Group).role === 'col-header') {\n const x = -(group.attribute.x ?? 0) + table.getFrozenColsWidth();\n const y = 0;\n const width = group.parent.attribute.width - table.getFrozenColsWidth() - table.getRightFrozenColsWidth();\n const height = table.getFrozenRowsHeight();\n context.beginPath();\n context.rect(x, y, width, height);\n } else if ((group as Group).role === 'right-frozen') {\n const x = 0;\n const y = -(group.attribute.y ?? 0) + table.getFrozenRowsHeight();\n const width = table.getRightFrozenColsWidth();\n const height = group.parent.attribute.height - table.getFrozenRowsHeight() - table.getBottomFrozenRowsHeight();\n context.beginPath();\n context.rect(x, y, width, height);\n } else if ((group as Group).role === 'bottom-frozen') {\n const x = -(group.attribute.x ?? 0) + table.getFrozenColsWidth();\n const y = 0;\n const width = group.parent.attribute.width - table.getFrozenColsWidth() - table.getRightFrozenColsWidth();\n const height = table.getBottomFrozenRowsHeight();\n context.beginPath();\n context.rect(x, y, width, height);\n } else if ((group as Group).role === 'corner-header') {\n const x = 0;\n const y = 0;\n const width = table.getFrozenColsWidth();\n const height = table.getFrozenRowsHeight();\n context.beginPath();\n context.rect(x, y, width, height);\n } else if ((group as Group).role === 'corner-right-top-header') {\n const x = 0;\n const y = 0;\n const width = table.getRightFrozenColsWidth();\n const height = table.getFrozenRowsHeight();\n context.beginPath();\n context.rect(x, y, width, height);\n } else if ((group as Group).role === 'corner-right-bottom-header') {\n const x = 0;\n const y = 0;\n const width = table.getRightFrozenColsWidth();\n const height = table.getBottomFrozenRowsHeight();\n context.beginPath();\n context.rect(x, y, width, height);\n } else if ((group as Group).role === 'corner-left-bottom-header') {\n const x = 0;\n const y = 0;\n const width = table.getFrozenColsWidth();\n const height = table.getBottomFrozenRowsHeight();\n context.beginPath();\n context.rect(x, y, width, height);\n }\n }\n}\n@injectable()\nexport class ClipBodyGroupAfterRenderContribution implements IGroupRenderContribution {\n time: BaseRenderContributionTime = BaseRenderContributionTime.afterFillStroke;\n useStyle = true;\n order = 0;\n drawShape(\n group: IGroup,\n context: IContext2d,\n x: number,\n y: number,\n doFill: boolean,\n doStroke: boolean,\n fVisible: boolean,\n sVisible: boolean,\n groupAttribute: Required<IGroupGraphicAttribute>,\n drawContext: IDrawContext,\n fillCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean,\n strokeCb?: (\n ctx: IContext2d,\n markAttribute: Partial<IMarkAttribute & IGraphicAttribute>,\n themeAttribute: IThemeAttribute\n ) => boolean\n ) {\n // 处理hover颜色\n if ((group as Group).role === 'body') {\n }\n }\n}\n\nfunction getCellSizeForDraw(group: any, width: number, height: number) {\n const table = group.stage.table as BaseTableAPI;\n if (group.role === 'cell') {\n let col = group.col as number;\n let row = group.row as number;\n const mergeInfo = getCellMergeInfo(table, col, row);\n if (mergeInfo) {\n col = mergeInfo.end.col;\n row = mergeInfo.end.row;\n }\n\n if (table && col === table.colCount - 1) {\n width -= 1;\n } else if (table && col === table.frozenColCount - 1 && table.scrollLeft) {\n width -= 1;\n }\n if (table && row === table.rowCount - 1) {\n height -= 1;\n } else if (table && row === table.frozenRowCount - 1 && table.scrollTop) {\n height -= 1;\n }\n } else if (group.role === 'corner-frozen') {\n if (table && table.scrollLeft) {\n width -= 1;\n }\n if (table && table.scrollTop) {\n height -= 1;\n }\n }\n return { width, height };\n}\n\nfunction getQuadLineDash(lineDash: number[][]) {\n if (lineDash.length === 1) {\n return [lineDash[0], lineDash[0], lineDash[0], lineDash[0]];\n } else if (lineDash.length === 2) {\n return [lineDash[0], lineDash[1], lineDash[0], lineDash[1]];\n }\n // 不考虑三个数的情况,三个数是用户传错了\n return lineDash;\n}\n"]}
@@ -243,7 +243,7 @@ function computeTextWidth(col, row, cellType, table) {
243
243
  } else text = (0, vutils_1.isObject)(cellValue) ? cellValue.text : cellValue; else text = cellValue;
244
244
  const lines = (0, break_string_1.breakString)(text, table);
245
245
  if (lines.length >= 1 ? lines.forEach((line => {
246
- const width = table.measureText(line.slice(0, table.options.maxCharactersNumber || 200), {
246
+ const width = table.measureText(line, {
247
247
  fontSize: fontSize,
248
248
  fontFamily: fontFamily,
249
249
  fontWeight: fontWeight