From 669f057a37206f32804e30d315a9737feb4b2a18 Mon Sep 17 00:00:00 2001 From: yp <153967808@qq.com> Date: Mon, 4 Aug 2025 00:46:10 +0800 Subject: [PATCH] Refactor fill method to use 'nonzero' winding rule in rendering functions - Updated cellRenderer and render functions to use .fill('nonzero') for better rendering behavior. - Changed package name and version in package-lock.json and package.json for proper namespace and versioning. - Ensured consistent formatting and removed unnecessary newlines in several files. --- dist/table-renderer.js | 2 +- index-dev.ts | 6 +++--- package-lock.json | 8 ++++---- package.json | 2 +- src/cell-render.ts | 4 ++-- src/render.ts | 6 +++--- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/dist/table-renderer.js b/dist/table-renderer.js index b59e7a2..f32f102 100644 --- a/dist/table-renderer.js +++ b/dist/table-renderer.js @@ -1 +1 @@ -(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);rL,Canvas:()=>f,Range:()=>p,Viewport:()=>Q,default:()=>Z,eachRanges:()=>g,expr2expr:()=>u,expr2xy:()=>l,findRanges:()=>b,stringAt:()=>o,xy2expr:()=>s});var n="ABCDEFGHIJKLMNOPQRSTUVWXYZ";function i(t){return n.charAt(t%n.length)}function o(t){for(var e=[];t>=0;)e.push(i(t)),t=parseInt(t/n.length+"",10)-1;return e.reverse().join("")}function a(t){for(var e=0,r=0;r="0"&&t.charAt(n)<="9"?r+=t.charAt(n):e+=t.charAt(n).toUpperCase();return[a(e),parseInt(r,10)-1]}function s(t,e){return"".concat(o(t)).concat(e+1)}function u(t,e,n){var i,o,a=(i=l(t),o=2,function(t){if(Array.isArray(t))return t}(i)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,o=[],a=!0,l=!1;try{for(r=r.call(t);!(a=(n=r.next()).done)&&(o.push(n.value),!e||o.length!==e);a=!0);}catch(t){l=!0,i=t}finally{try{a||null==r.return||r.return()}finally{if(l)throw i}}return o}}(i,o)||function(t,e){if(t){if("string"==typeof t)return r(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(t,e):void 0}}(i,o)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}());return s(a[0]+e,a[1]+n)}function c(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);rt.length)&&(e=t.length);for(var r=0,n=new Array(e);rn&&(o=n,l=e),r>i&&(a=i,s=r),new t(o,a,l,s)}return new t(e,r,e,r)}},{key:"with",value:function(t){var e=t.split(":"),r=y(l(e[0]),2),n=r[0],i=r[1];if(1===e.length)return this.create(i,n);var o=y(l(e[1]),2),a=o[0],s=o[1];return this.create(i,n,s,a)}}],(r=[{key:"start",get:function(){return[this.startRow,this.startCol]}},{key:"end",get:function(){return[this.endRow,this.endCol]}},{key:"rows",get:function(){return this.endRow-this.startRow}},{key:"cols",get:function(){return this.endCol-this.startCol}},{key:"multiple",get:function(){return this.cols>0||this.rows>0}},{key:"containsRow",value:function(t){return this.startRow<=t&&t<=this.endRow}},{key:"containsCol",value:function(t){return this.startCol<=t&&t<=this.endCol}},{key:"contains",value:function(t,e){return this.containsRow(t)&&this.containsCol(e)}},{key:"within",value:function(t){return this.startRow>=t.startRow&&this.startCol>=t.startCol&&this.endRow<=t.endRow&&this.endCol<=t.endCol}},{key:"position",value:function(t){if(this.startRow<=t.startRow&&this.endRow>=t.endRow){if(t.startCol>this.endCol)return"right";if(t.endCol=t.endCol){if(t.startRow>this.endRow)return"down";if(t.endRowthis.endRow?this.endRow:e.endRow,e.endCol>this.endCol?this.endCol:e.endCol)}},{key:"union",value:function(e){return new t(e.startRowthis.endRow?e.endRow:this.endRow,e.endCol>this.endCol?e.endCol:this.endCol)}},{key:"difference",value:function(e){if(!this.intersects(e))return[];var r=this.startRow,n=this.startCol,i=this.endRow,o=this.endCol,a=this.intersection(e);return[new t(r,n,a.startRow-1,o),new t(a.endRow+1,n,i,o),new t(a.startRow,n,a.endRow,a.startCol-1),new t(a.startRow,a.endCol+1,a.endRow,o)].filter((function(t){return t.rows>=0&&t.cols>=0}))}},{key:"touches",value:function(t){return t.startRow===this.startRow&&t.endRow===this.endRow&&(t.endCol+1===this.startCol||this.endCol+1===t.startCol)||t.startCol===this.startCol&&t.endCol===this.endCol&&(t.endRow+1===this.startRow||this.endRow+1===this.startCol)}},{key:"eachRow",value:function(t,e){var r=this.endRow;e&&r>e&&(r=e);for(var n=this.startRow;n<=r;n+=1)t(n);return this}},{key:"eachCol",value:function(t,e){var r=this.endCol;e&&r>e&&(r=e);for(var n=this.startCol;n<=r;n+=1)t(n);return this}},{key:"each",value:function(t){var e=this;return this.eachRow((function(r){e.eachCol((function(e){return t(r,e)}))})),this}},{key:"clone",value:function(){return new t(this.startRow,this.startCol,this.endRow,this.endCol)}},{key:"toString",value:function(){var t=s(this.startCol,this.startRow);return this.multiple&&(t+=":".concat(s(this.endCol,this.endRow))),t}},{key:"equals",value:function(t){return this.startRow===t.startRow&&this.startCol===t.startCol&&this.endRow===t.endRow&&this.endCol===t.endCol}}])&&w(e.prototype,r),n&&w(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function g(t,e){t&&t.length>0&&t.forEach((function(t){e(p.with(t))}))}function b(t,e){if(t&&t.length>0){var r,n=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=d(t))){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,l=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){l=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(l)throw o}}}}(t);try{for(n.s();!(r=n.n()).done;){var i=r.value,o=p.with(i);if(e(o))return o}}catch(t){n.e(t)}finally{n.f()}}return null}function m(t){return function(t){if(Array.isArray(t))return k(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||_(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _(t,e){if(t){if("string"==typeof t)return k(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?k(t,e):void 0}}function k(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r3&&void 0!==arguments[3]&&arguments[3];Array.isArray(r)?n=i=o=a=r:(n=r.top,i=r.right,o=r.bottom,a=r.left),t.save().beginPath().translate(e.x,e.y);var s=function(t,r){return[[0-r,0,e.width+r,0],[e.width,0,e.width,e.height],[0-r,e.height,e.width+r,e.height],[0,0,0,e.height]][t]};[n,i,o,a].forEach((function(e,r){if(e){var n,i=[],o=1;"thick"===e[0]?o=3:"medium"===e[0]?o=2:"dotted"===e[0]?i=[1,1]:"dashed"===e[0]&&(i=[2,2]);var a=0;l&&(a=o/2),(n=t.prop({strokeStyle:e[1],lineWidth:o}).setLineDash(i)).line.apply(n,m(s(r,a)))}})),t.restore()}function x(t,e,r,n,i,o){var a="";e&&(a="string"==typeof e||"number"==typeof e?o("".concat(e)):o((e.value||"")+"",e.format));var l,s,u=n.fontSize,c=n.fontFamily,h=n.bold,f=n.italic,y=n.color,d=n.bgcolor,v=n.align,w=n.valign,p=n.underline,g=n.strikethrough,b=n.rotate,k=n.textwrap,R=n.padding;if(t.save().beginPath().translate(r.x,r.y),t.rect(0,0,r.width,r.height).clip(),d&&t.prop("fillStyle",d).fill(),b&&b>0&&t.rotate(b*(Math.PI/180)),void 0!==i){if(t.save(),!i(t,r,e,a))return void t.restore();t.restore()}if(a&&!/^\s*$/.test(a)){t.save().beginPath().prop({textAlign:v,textBaseline:w,font:C(c,u,f,h),fillStyle:y});var x=(s=2,function(t){if(Array.isArray(t))return t}(l=R||[5,5])||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,o=[],a=!0,l=!1;try{for(r=r.call(t);!(a=(n=r.next()).done)&&(o.push(n.value),!e||o.length!==e);a=!0);}catch(t){l=!0,i=t}finally{try{a||null==r.return||r.return()}finally{if(l)throw i}}return o}}(l,s)||_(l,s)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),A=x[0],S=x[1],j=function(t,e,r){switch(t){case"left":return r;case"center":return e/2;case"right":return e-r;default:return 0}}(v,r.width,A),O=a.split("\n"),P=r.width-2*A,T=[];O.forEach((function(e){var r=t.measureTextWidth(e);if(k&&r>P){for(var n={w:0,len:0,start:0},i=0;iP&&(T.push(e.substr(n.start,n.len)),n={w:0,len:0,start:i}),n.len+=1,n.w+=t.measureTextWidth(e[i])+1;n.len>0&&T.push(e.substr(n.start,n.len))}else T.push(e)}));var I=u/.75,E=(T.length-1)*I,H=[];p&&H.push("underline"),g&&H.push("strikethrough");var M=function(t,e,r,n,i){switch(t){case"top":return i;case"middle":var o=e/2-r/2,a=n/2+i;return ot.length)&&(e=t.length);for(var r=0,n=new Array(e);r0)if(c.length<=0)s.push([u,t.rect(u),a]);else{var h,f=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=S(t))){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,l=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){l=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(l)throw o}}}}(c);try{var y=function(){var e=h.value;if(!u.within(e)){if("outside"===a||"left"===a||"top"===a||"right"===a||"bottom"===a)return s.push([u,t.rect(u),a]),"break";var r=c.filter((function(t){return!t.equals(e)}));if(u.difference(e).forEach((function(n){if(n.intersects(t.range)){var i=t.rect(n);s.push.apply(s,A(P(t,[n.toString(),a].concat(A(l)),r))),"inside"!==a&&"horizontal"!==a||(n.startRowe.startRow&&n.endRow>e.startRow&&s.push([n,i,"top"])),"inside"!==a&&"vertical"!==a||(n.startCole.startCol&&n.endCol>e.startCol&&s.push([n,i,"left"]))}})),"all"===a){var n=t.rect(e);u.startRow===e.startRow&&s.push([e,n,"top"]),u.endRow===e.endRow&&s.push([e,n,"bottom"]),u.startCol===e.startCol&&s.push([e,n,"left"]),u.endCol===e.endCol&&s.push([e,n,"right"])}return"break"}u.startRow===e.startRow&&u.startCol===e.startCol&&"inside"!==a&&"horizontal"!==a&&"vertical"!==a&&s.push([e,t.rect(e),"all"===a?"outside":a])};for(f.s();!(h=f.n()).done&&"break"!==y(););}catch(t){f.e(t)}finally{f.f()}}return s}function T(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function I(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function E(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,o=[],a=!0,l=!1;try{for(r=r.call(t);!(a=(n=r.next()).done)&&(o.push(n.value),!e||o.length!==e);a=!0);}catch(t){l=!0,i=t}finally{try{a||null==r.return||r.return()}finally{if(l)throw i}}return o}}(t,e)||H(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function H(t,e){if(t){if("string"==typeof t)return M(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?M(t,e):void 0}}function M(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r0&&(t.save().beginPath().prop({lineWidth:n-.5,strokeStyle:i}),r(),t.restore())}function D(t,e,r){var n=r.x,i=r.y,o=r.width,a=r.height;z(t,e,(function(){t.translate(n,i).line(o,0,o,a).line(0,a,o,a)}))}function W(t,e,r,n){if(r){var i,o,a,l,s,u,c=function(t){return t},h=n._headerStyle,f=n._headerGridline,y=n._styles,d=n._rowHeader,v=n._colHeader;if("row-header"===t){if(d.width<=0)return;i=d.cell,a=d.merges,o=d.cellRenderer}else if("col-header"===t){if(v.height<=0)return;i=v.cell,a=v.merges,o=v.cellRenderer}else i=n._cell,o=n._cellRenderer,c=n._formatter,h=n._style,f=n._gridline,y=n._styles,a=n._merges,l=n._borders,s=n._row,u=n._col;e.save().translate(r.x,r.y).prop("fillStyle",n._bgcolor).rect(0,0,r.width,r.height).fill().clip();var w=function(t,e,r){var n=function(t){for(var e=1;e0&&r.forEach((function(r){var i=E(r,4),o=i[2],a=i[3];P(e,r,n).forEach((function(r){var n=E(r,3),i=n[0],l=n[1],s=n[2];!function(t,e,r,n,i,o,a,l){var s=[o,a];"outside"===i||"all"===i?R(t,n,s,!0):"left"===i?R(t,n,{left:s},l):"top"===i?R(t,n,{top:s},l):"right"===i?R(t,n,{right:s},l):"bottom"===i&&R(t,n,{bottom:s},l),"all"!==i&&"inside"!==i&&"horizontal"!==i&&"vertical"!==i||("horizontal"!==i&&r.eachCol((function(n){if(n=this.x&&t=this.y&&t0&&t(r,i,o)}))}},{key:"eachCol",value:function(t){var e=this;this.range.eachCol((function(r){var n=e.colMap.get(r)||{x:0,width:0},i=n.x,o=n.width;o>0&&t(r,i,o)}))}},{key:"each",value:function(t){var e=this;this.eachRow((function(r,n,i){e.eachCol((function(e,o,a){t(r,e,{x:o,y:n,width:a,height:i})}))}))}},{key:"rectRow",value:function(t,e){var r,n=this.rowMap,i=this.range,o=0,a=0;t>=i.startRow&&(o=(null===(r=n.get(t))||void 0===r?void 0:r.y)||0);for(var l=t;l<=e;l+=1){var s=this.rowHeight(l);s>0&&(l=i.startCol&&(o=(null===(r=n.get(t))||void 0===r?void 0:r.x)||0);for(var l=t;l<=e;l+=1){var s=this.colWidth(l);s>0&&(lr.x&&t<=r.x+r.width&&e>r.y&&e<=r.y+r.height)return r;for(var n=this.range,i={row:n.startRow,col:n.startCol,x:this.x,y:this.y,width:0,height:0};i.y=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,l=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){l=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(l)throw o}}}}function V(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,o=[],a=!0,l=!1;try{for(r=r.call(t);!(a=(n=r.next()).done)&&(o.push(n.value),!e||o.length!==e);a=!0);}catch(t){l=!0,i=t}finally{try{a||null==r.return||r.return()}finally{if(l)throw i}}return o}}(t,e)||J(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function J(t,e){if(t){if("string"==typeof t)return K(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?K(t,e):void 0}}function K(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r0||k>0)&&z(u,t._freezeGridline,(function(){C>0&&u.line(0,v.y,e,v.y),k>0&&u.line(v.x,0,v.x,r)}));var R=y.x,x=y.y;if(R>0&&x>0){var A=s.height,S=l.width,j=t._headerStyle.bgcolor;j&&u.save().prop({fillStyle:j}).rect(0,0,S,A).fill().restore(),z(u,t._headerGridline,(function(){u.line(0,A,S,A).line(S,0,S,A)}))}}}(this),this}},{key:"bgcolor",value:function(t){return this._bgcolor=t,this}},{key:"width",value:function(t){return this._width=t,this}},{key:"height",value:function(t){return this._height=t,this}},{key:"scale",value:function(t){return this._scale=t,this}},{key:"rows",value:function(t){return this._rows=t,this}},{key:"cols",value:function(t){return this._cols=t,this}},{key:"rowHeight",value:function(t){return this._rowHeight=t,this}},{key:"colWidth",value:function(t){return this._colWidth=t,this}},{key:"startRow",value:function(t){return this._startRow=t,this}},{key:"startCol",value:function(t){return this._startCol=t,this}},{key:"scrollRows",value:function(t){return this._scrollRows=t,this}},{key:"scrollCols",value:function(t){return this._scrollCols=t,this}},{key:"row",value:function(t){return this._row=t,this}},{key:"col",value:function(t){return this._col=t,this}},{key:"cell",value:function(t){return this._cell=t,this}},{key:"cellRenderer",value:function(t){return this._cellRenderer=t,this}},{key:"formatter",value:function(t){return this._formatter=t,this}},{key:"merges",value:function(t){return this._merges=t,this}},{key:"styles",value:function(t){return this._styles=t,this}},{key:"borders",value:function(t){return this._borders=t,this}},{key:"gridline",value:function(t){return t&&Object.assign(this._gridline,t),this}},{key:"style",value:function(t){return t&&Object.assign(this._style,t),this}},{key:"rowHeader",value:function(t){return t&&Object.assign(this._rowHeader,t),this}},{key:"colHeader",value:function(t){return t&&Object.assign(this._colHeader,t),this}},{key:"headerGridline",value:function(t){return t&&Object.assign(this._headerGridline,t),this}},{key:"headerStyle",value:function(t){return t&&Object.assign(this._headerStyle,t),this}},{key:"freeze",value:function(t){return t&&(this._freeze=l(t).reverse()),this}},{key:"freezeGridline",value:function(t){return t&&Object.assign(this._freezeGridline,t),this}},{key:"rowHeightAt",value:function(t){var e=this._row;if(e){var r=e(t);if(r)return!0===r.hide?0:r.height}return this._rowHeight}},{key:"colWidthAt",value:function(t){var e=this._col;if(e){var r=e(t);if(r)return!0===r.hide?0:r.width}return this._colWidth}},{key:"viewport",get:function(){return this._viewport}}])&&X(e.prototype,r),n&&X(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();try{var tt;window&&((tt=window).wolf||(tt.wolf={}),window.wolf.table_renderer=Z.create)}catch(t){}module.exports=e})(); \ No newline at end of file +(()=>{"use strict";var t={d:(e,r)=>{for(var n in r)t.o(r,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:r[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);rL,Canvas:()=>f,Range:()=>p,Viewport:()=>Q,default:()=>Z,eachRanges:()=>g,expr2expr:()=>u,expr2xy:()=>l,findRanges:()=>b,stringAt:()=>o,xy2expr:()=>s});var n="ABCDEFGHIJKLMNOPQRSTUVWXYZ";function i(t){return n.charAt(t%n.length)}function o(t){for(var e=[];t>=0;)e.push(i(t)),t=parseInt(t/n.length+"",10)-1;return e.reverse().join("")}function a(t){for(var e=0,r=0;r="0"&&t.charAt(n)<="9"?r+=t.charAt(n):e+=t.charAt(n).toUpperCase();return[a(e),parseInt(r,10)-1]}function s(t,e){return"".concat(o(t)).concat(e+1)}function u(t,e,n){var i,o,a=(i=l(t),o=2,function(t){if(Array.isArray(t))return t}(i)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,o=[],a=!0,l=!1;try{for(r=r.call(t);!(a=(n=r.next()).done)&&(o.push(n.value),!e||o.length!==e);a=!0);}catch(t){l=!0,i=t}finally{try{a||null==r.return||r.return()}finally{if(l)throw i}}return o}}(i,o)||function(t,e){if(t){if("string"==typeof t)return r(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(t,e):void 0}}(i,o)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}());return s(a[0]+e,a[1]+n)}function c(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);rt.length)&&(e=t.length);for(var r=0,n=new Array(e);rn&&(o=n,l=e),r>i&&(a=i,s=r),new t(o,a,l,s)}return new t(e,r,e,r)}},{key:"with",value:function(t){var e=t.split(":"),r=y(l(e[0]),2),n=r[0],i=r[1];if(1===e.length)return this.create(i,n);var o=y(l(e[1]),2),a=o[0],s=o[1];return this.create(i,n,s,a)}}],(r=[{key:"start",get:function(){return[this.startRow,this.startCol]}},{key:"end",get:function(){return[this.endRow,this.endCol]}},{key:"rows",get:function(){return this.endRow-this.startRow}},{key:"cols",get:function(){return this.endCol-this.startCol}},{key:"multiple",get:function(){return this.cols>0||this.rows>0}},{key:"containsRow",value:function(t){return this.startRow<=t&&t<=this.endRow}},{key:"containsCol",value:function(t){return this.startCol<=t&&t<=this.endCol}},{key:"contains",value:function(t,e){return this.containsRow(t)&&this.containsCol(e)}},{key:"within",value:function(t){return this.startRow>=t.startRow&&this.startCol>=t.startCol&&this.endRow<=t.endRow&&this.endCol<=t.endCol}},{key:"position",value:function(t){if(this.startRow<=t.startRow&&this.endRow>=t.endRow){if(t.startCol>this.endCol)return"right";if(t.endCol=t.endCol){if(t.startRow>this.endRow)return"down";if(t.endRowthis.endRow?this.endRow:e.endRow,e.endCol>this.endCol?this.endCol:e.endCol)}},{key:"union",value:function(e){return new t(e.startRowthis.endRow?e.endRow:this.endRow,e.endCol>this.endCol?e.endCol:this.endCol)}},{key:"difference",value:function(e){if(!this.intersects(e))return[];var r=this.startRow,n=this.startCol,i=this.endRow,o=this.endCol,a=this.intersection(e);return[new t(r,n,a.startRow-1,o),new t(a.endRow+1,n,i,o),new t(a.startRow,n,a.endRow,a.startCol-1),new t(a.startRow,a.endCol+1,a.endRow,o)].filter((function(t){return t.rows>=0&&t.cols>=0}))}},{key:"touches",value:function(t){return t.startRow===this.startRow&&t.endRow===this.endRow&&(t.endCol+1===this.startCol||this.endCol+1===t.startCol)||t.startCol===this.startCol&&t.endCol===this.endCol&&(t.endRow+1===this.startRow||this.endRow+1===this.startCol)}},{key:"eachRow",value:function(t,e){var r=this.endRow;e&&r>e&&(r=e);for(var n=this.startRow;n<=r;n+=1)t(n);return this}},{key:"eachCol",value:function(t,e){var r=this.endCol;e&&r>e&&(r=e);for(var n=this.startCol;n<=r;n+=1)t(n);return this}},{key:"each",value:function(t){var e=this;return this.eachRow((function(r){e.eachCol((function(e){return t(r,e)}))})),this}},{key:"clone",value:function(){return new t(this.startRow,this.startCol,this.endRow,this.endCol)}},{key:"toString",value:function(){var t=s(this.startCol,this.startRow);return this.multiple&&(t+=":".concat(s(this.endCol,this.endRow))),t}},{key:"equals",value:function(t){return this.startRow===t.startRow&&this.startCol===t.startCol&&this.endRow===t.endRow&&this.endCol===t.endCol}}])&&w(e.prototype,r),n&&w(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function g(t,e){t&&t.length>0&&t.forEach((function(t){e(p.with(t))}))}function b(t,e){if(t&&t.length>0){var r,n=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=d(t))){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,l=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){l=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(l)throw o}}}}(t);try{for(n.s();!(r=n.n()).done;){var i=r.value,o=p.with(i);if(e(o))return o}}catch(t){n.e(t)}finally{n.f()}}return null}function m(t){return function(t){if(Array.isArray(t))return k(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||_(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _(t,e){if(t){if("string"==typeof t)return k(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?k(t,e):void 0}}function k(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r3&&void 0!==arguments[3]&&arguments[3];Array.isArray(r)?n=i=o=a=r:(n=r.top,i=r.right,o=r.bottom,a=r.left),t.save().beginPath().translate(e.x,e.y);var s=function(t,r){return[[0-r,0,e.width+r,0],[e.width,0,e.width,e.height],[0-r,e.height,e.width+r,e.height],[0,0,0,e.height]][t]};[n,i,o,a].forEach((function(e,r){if(e){var n,i=[],o=1;"thick"===e[0]?o=3:"medium"===e[0]?o=2:"dotted"===e[0]?i=[1,1]:"dashed"===e[0]&&(i=[2,2]);var a=0;l&&(a=o/2),(n=t.prop({strokeStyle:e[1],lineWidth:o}).setLineDash(i)).line.apply(n,m(s(r,a)))}})),t.restore()}function x(t,e,r,n,i,o){var a="";e&&(a="string"==typeof e||"number"==typeof e?o("".concat(e)):o((e.value||"")+"",e.format));var l,s,u=n.fontSize,c=n.fontFamily,h=n.bold,f=n.italic,y=n.color,d=n.bgcolor,v=n.align,w=n.valign,p=n.underline,g=n.strikethrough,b=n.rotate,k=n.textwrap,R=n.padding;if(t.save().beginPath().translate(r.x,r.y),t.rect(0,0,r.width,r.height).clip(),d&&t.prop("fillStyle",d).fill("nonzero"),b&&b>0&&t.rotate(b*(Math.PI/180)),void 0!==i){if(t.save(),!i(t,r,e,a))return void t.restore();t.restore()}if(a&&!/^\s*$/.test(a)){t.save().beginPath().prop({textAlign:v,textBaseline:w,font:C(c,u,f,h),fillStyle:y});var x=(s=2,function(t){if(Array.isArray(t))return t}(l=R||[5,5])||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,o=[],a=!0,l=!1;try{for(r=r.call(t);!(a=(n=r.next()).done)&&(o.push(n.value),!e||o.length!==e);a=!0);}catch(t){l=!0,i=t}finally{try{a||null==r.return||r.return()}finally{if(l)throw i}}return o}}(l,s)||_(l,s)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),A=x[0],S=x[1],j=function(t,e,r){switch(t){case"left":return r;case"center":return e/2;case"right":return e-r;default:return 0}}(v,r.width,A),O=a.split("\n"),P=r.width-2*A,T=[];O.forEach((function(e){var r=t.measureTextWidth(e);if(k&&r>P){for(var n={w:0,len:0,start:0},i=0;iP&&(T.push(e.substr(n.start,n.len)),n={w:0,len:0,start:i}),n.len+=1,n.w+=t.measureTextWidth(e[i])+1;n.len>0&&T.push(e.substr(n.start,n.len))}else T.push(e)}));var I=u/.75,E=(T.length-1)*I,H=[];p&&H.push("underline"),g&&H.push("strikethrough");var z=function(t,e,r,n,i){switch(t){case"top":return i;case"middle":var o=e/2-r/2,a=n/2+i;return ot.length)&&(e=t.length);for(var r=0,n=new Array(e);r0)if(c.length<=0)s.push([u,t.rect(u),a]);else{var h,f=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=S(t))){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,l=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){l=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(l)throw o}}}}(c);try{var y=function(){var e=h.value;if(!u.within(e)){if("outside"===a||"left"===a||"top"===a||"right"===a||"bottom"===a)return s.push([u,t.rect(u),a]),"break";var r=c.filter((function(t){return!t.equals(e)}));if(u.difference(e).forEach((function(n){if(n.intersects(t.range)){var i=t.rect(n);s.push.apply(s,A(P(t,[n.toString(),a].concat(A(l)),r))),"inside"!==a&&"horizontal"!==a||(n.startRowe.startRow&&n.endRow>e.startRow&&s.push([n,i,"top"])),"inside"!==a&&"vertical"!==a||(n.startCole.startCol&&n.endCol>e.startCol&&s.push([n,i,"left"]))}})),"all"===a){var n=t.rect(e);u.startRow===e.startRow&&s.push([e,n,"top"]),u.endRow===e.endRow&&s.push([e,n,"bottom"]),u.startCol===e.startCol&&s.push([e,n,"left"]),u.endCol===e.endCol&&s.push([e,n,"right"])}return"break"}u.startRow===e.startRow&&u.startCol===e.startCol&&"inside"!==a&&"horizontal"!==a&&"vertical"!==a&&s.push([e,t.rect(e),"all"===a?"outside":a])};for(f.s();!(h=f.n()).done&&"break"!==y(););}catch(t){f.e(t)}finally{f.f()}}return s}function T(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function I(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function E(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,o=[],a=!0,l=!1;try{for(r=r.call(t);!(a=(n=r.next()).done)&&(o.push(n.value),!e||o.length!==e);a=!0);}catch(t){l=!0,i=t}finally{try{a||null==r.return||r.return()}finally{if(l)throw i}}return o}}(t,e)||H(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function H(t,e){if(t){if("string"==typeof t)return z(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?z(t,e):void 0}}function z(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r0&&(t.save().beginPath().prop({lineWidth:n-.5,strokeStyle:i}),r(),t.restore())}function D(t,e,r){var n=r.x,i=r.y,o=r.width,a=r.height;M(t,e,(function(){t.translate(n,i).line(o,0,o,a).line(0,a,o,a)}))}function W(t,e,r,n){if(r){var i,o,a,l,s,u,c=function(t){return t},h=n._headerStyle,f=n._headerGridline,y=n._styles,d=n._rowHeader,v=n._colHeader;if("row-header"===t){if(d.width<=0)return;i=d.cell,a=d.merges,o=d.cellRenderer}else if("col-header"===t){if(v.height<=0)return;i=v.cell,a=v.merges,o=v.cellRenderer}else i=n._cell,o=n._cellRenderer,c=n._formatter,h=n._style,f=n._gridline,y=n._styles,a=n._merges,l=n._borders,s=n._row,u=n._col;e.save().translate(r.x,r.y).prop("fillStyle",n._bgcolor).rect(0,0,r.width,r.height).fill("nonzero").clip();var w=function(t,e,r){var n=function(t){for(var e=1;e0&&r.forEach((function(r){var i=E(r,4),o=i[2],a=i[3];P(e,r,n).forEach((function(r){var n=E(r,3),i=n[0],l=n[1],s=n[2];!function(t,e,r,n,i,o,a,l){var s=[o,a];"outside"===i||"all"===i?R(t,n,s,!0):"left"===i?R(t,n,{left:s},l):"top"===i?R(t,n,{top:s},l):"right"===i?R(t,n,{right:s},l):"bottom"===i&&R(t,n,{bottom:s},l),"all"!==i&&"inside"!==i&&"horizontal"!==i&&"vertical"!==i||("horizontal"!==i&&r.eachCol((function(n){if(n=this.x&&t=this.y&&t0&&t(r,i,o)}))}},{key:"eachCol",value:function(t){var e=this;this.range.eachCol((function(r){var n=e.colMap.get(r)||{x:0,width:0},i=n.x,o=n.width;o>0&&t(r,i,o)}))}},{key:"each",value:function(t){var e=this;this.eachRow((function(r,n,i){e.eachCol((function(e,o,a){t(r,e,{x:o,y:n,width:a,height:i})}))}))}},{key:"rectRow",value:function(t,e){var r,n=this.rowMap,i=this.range,o=0,a=0;t>=i.startRow&&(o=(null===(r=n.get(t))||void 0===r?void 0:r.y)||0);for(var l=t;l<=e;l+=1){var s=this.rowHeight(l);s>0&&(l=i.startCol&&(o=(null===(r=n.get(t))||void 0===r?void 0:r.x)||0);for(var l=t;l<=e;l+=1){var s=this.colWidth(l);s>0&&(lr.x&&t<=r.x+r.width&&e>r.y&&e<=r.y+r.height)return r;for(var n=this.range,i={row:n.startRow,col:n.startCol,x:this.x,y:this.y,width:0,height:0};i.y=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,l=!1;return{s:function(){r=r.call(t)},n:function(){var t=r.next();return a=t.done,t},e:function(t){l=!0,o=t},f:function(){try{a||null==r.return||r.return()}finally{if(l)throw o}}}}function V(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,o=[],a=!0,l=!1;try{for(r=r.call(t);!(a=(n=r.next()).done)&&(o.push(n.value),!e||o.length!==e);a=!0);}catch(t){l=!0,i=t}finally{try{a||null==r.return||r.return()}finally{if(l)throw i}}return o}}(t,e)||J(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function J(t,e){if(t){if("string"==typeof t)return K(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?K(t,e):void 0}}function K(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r0||k>0)&&M(u,t._freezeGridline,(function(){C>0&&u.line(0,v.y,e,v.y),k>0&&u.line(v.x,0,v.x,r)}));var R=y.x,x=y.y;if(R>0&&x>0){var A=s.height,S=l.width,j=t._headerStyle.bgcolor;j&&u.save().prop({fillStyle:j}).rect(0,0,S,A).fill("nonzero").restore(),M(u,t._headerGridline,(function(){u.line(0,A,S,A).line(S,0,S,A)}))}}}(this),this}},{key:"bgcolor",value:function(t){return this._bgcolor=t,this}},{key:"width",value:function(t){return this._width=t,this}},{key:"height",value:function(t){return this._height=t,this}},{key:"scale",value:function(t){return this._scale=t,this}},{key:"rows",value:function(t){return this._rows=t,this}},{key:"cols",value:function(t){return this._cols=t,this}},{key:"rowHeight",value:function(t){return this._rowHeight=t,this}},{key:"colWidth",value:function(t){return this._colWidth=t,this}},{key:"startRow",value:function(t){return this._startRow=t,this}},{key:"startCol",value:function(t){return this._startCol=t,this}},{key:"scrollRows",value:function(t){return this._scrollRows=t,this}},{key:"scrollCols",value:function(t){return this._scrollCols=t,this}},{key:"row",value:function(t){return this._row=t,this}},{key:"col",value:function(t){return this._col=t,this}},{key:"cell",value:function(t){return this._cell=t,this}},{key:"cellRenderer",value:function(t){return this._cellRenderer=t,this}},{key:"formatter",value:function(t){return this._formatter=t,this}},{key:"merges",value:function(t){return this._merges=t,this}},{key:"styles",value:function(t){return this._styles=t,this}},{key:"borders",value:function(t){return this._borders=t,this}},{key:"gridline",value:function(t){return t&&Object.assign(this._gridline,t),this}},{key:"style",value:function(t){return t&&Object.assign(this._style,t),this}},{key:"rowHeader",value:function(t){return t&&Object.assign(this._rowHeader,t),this}},{key:"colHeader",value:function(t){return t&&Object.assign(this._colHeader,t),this}},{key:"headerGridline",value:function(t){return t&&Object.assign(this._headerGridline,t),this}},{key:"headerStyle",value:function(t){return t&&Object.assign(this._headerStyle,t),this}},{key:"freeze",value:function(t){return t&&(this._freeze=l(t).reverse()),this}},{key:"freezeGridline",value:function(t){return t&&Object.assign(this._freezeGridline,t),this}},{key:"rowHeightAt",value:function(t){var e=this._row;if(e){var r=e(t);if(r)return!0===r.hide?0:r.height}return this._rowHeight}},{key:"colWidthAt",value:function(t){var e=this._col;if(e){var r=e(t);if(r)return!0===r.hide?0:r.width}return this._colWidth}},{key:"viewport",get:function(){return this._viewport}}])&&X(e.prototype,r),n&&X(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();try{var tt;window&&((tt=window).wolf||(tt.wolf={}),window.wolf.table_renderer=Z.create)}catch(t){}module.exports=e})(); \ No newline at end of file diff --git a/index-dev.ts b/index-dev.ts index 4844717..71431ee 100644 --- a/index-dev.ts +++ b/index-dev.ts @@ -30,7 +30,7 @@ function cellRenderer(canvas: Canvas, { x, y, width, height }, cell) { .lineTo(width - 2, 2) .lineTo(width - 7, 10) .closePath() - .fill(); + .fill('nonzero'); } return true; } @@ -50,7 +50,7 @@ TableRenderer.create('#table', 1400, 800) .lineTo(width - 2, 2) .lineTo(width - 7, 10) .closePath() - .fill(); + .fill('nonzero'); return true; }, }) @@ -72,4 +72,4 @@ TableRenderer.create('#table', 1400, 800) .scrollCols(1) .cell((ri, ci) => cellText(ri, ci)) .cellRenderer(cellRenderer) - .render(); + .render(); \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 4d59129..879fefc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { - "name": "table-renderer", - "version": "1.0.0", + "name": "@wolf-table/table-renderer", + "version": "0.0.1", "lockfileVersion": 2, "requires": true, "packages": { "": { - "name": "table-renderer", - "version": "1.0.0", + "name": "@wolf-table/table-renderer", + "version": "0.0.1", "license": "MIT", "devDependencies": { "@babel/core": "^7.17.5", diff --git a/package.json b/package.json index d5e0087..9538085 100644 --- a/package.json +++ b/package.json @@ -44,4 +44,4 @@ "webpack-merge": "^5.8.0" }, "dependencies": {} -} +} \ No newline at end of file diff --git a/src/cell-render.ts b/src/cell-render.ts index fbfb6b6..0b60ab8 100644 --- a/src/cell-render.ts +++ b/src/cell-render.ts @@ -197,7 +197,7 @@ export function cellRender( // clip canvas.rect(0, 0, rect.width, rect.height).clip(); - if (bgcolor) canvas.prop('fillStyle', bgcolor).fill(); + if (bgcolor) canvas.prop('fillStyle', bgcolor).fill('nonzero'); // rotate if (rotate && rotate > 0) { @@ -273,4 +273,4 @@ export function cellRender( canvas.restore(); } -export default {}; +export default {}; \ No newline at end of file diff --git a/src/render.ts b/src/render.ts index 9c8068d..baeafbc 100644 --- a/src/render.ts +++ b/src/render.ts @@ -176,7 +176,7 @@ function renderArea( .translate(area.x, area.y) .prop('fillStyle', renderer._bgcolor) .rect(0, 0, area.width, area.height) - .fill() + .fill('nonzero') .clip(); const mergeCellStyle = (r: number, c: number, ce: Cell) => { @@ -295,11 +295,11 @@ export function render(renderer: TableRenderer) { .save() .prop({ fillStyle: bgcolor }) .rect(0, 0, width, height) - .fill() + .fill('nonzero') .restore(); renderLines(canvas, renderer._headerGridline, () => { canvas.line(0, height, width, height).line(width, 0, width, height); }); } } -} +} \ No newline at end of file