Browse Source

fix(underline and cancelline): add and fix

master
wbfsa 5 years ago
parent
commit
d3f23fffd7
  1. 2
      src/controllers/menuButton.js
  2. 37
      src/global/draw.js
  3. 1449
      src/global/getRowlen.js
  4. 3
      src/index.html

2
src/controllers/menuButton.js

@ -3314,7 +3314,7 @@ const menuButton = {
}, },
checkstatusByCell:function(cell, a){ checkstatusByCell:function(cell, a){
let foucsStatus =cell; let foucsStatus =cell;
let tf = {"bl":1, "it":1 , "ff":1, "cl":1}; let tf = {"bl":1, "it":1 , "ff":1, "cl":1, "un":1};
if(a in tf){ if(a in tf){
if(foucsStatus == null){ if(foucsStatus == null){

37
src/global/draw.js

@ -2054,6 +2054,43 @@ function cellTextRender(textInfo, ctx, option){
let word = values[i]; let word = values[i];
ctx.font = word.style; ctx.font = word.style;
ctx.fillText(word.content, (pos_x + word.left)/Store.zoomRatio, (pos_y+word.top)/Store.zoomRatio); ctx.fillText(word.content, (pos_x + word.left)/Store.zoomRatio, (pos_y+word.top)/Store.zoomRatio);
if(word.cancelLine!=null){
let c = word.cancelLine;
ctx.beginPath();
ctx.moveTo(
(pos_x +c.startX)/Store.zoomRatio ,
(pos_y+c.startY)/Store.zoomRatio
);
ctx.lineTo(
(pos_x +c.endX)/Store.zoomRatio,
(pos_y+c.endY)/Store.zoomRatio
);
ctx.lineWidth = 1;
ctx.strokeStyle = ctx.fillStyle;
ctx.stroke();
ctx.closePath();
}
if(word.underLine!=null){
let underLines = word.underLine;
for(let a=0;a<underLines.length;a++){
let item = underLines[a];
ctx.beginPath();
ctx.moveTo(
(pos_x +item.startX)/Store.zoomRatio ,
(pos_y+item.startY)/Store.zoomRatio
);
ctx.lineTo(
(pos_x +item.endX)/Store.zoomRatio,
(pos_y+ item.endY)/Store.zoomRatio
);
ctx.lineWidth = 1;
ctx.strokeStyle = ctx.fillStyle;
ctx.stroke();
ctx.closePath();
}
}
} }
// ctx.fillStyle = "rgba(0,0,0,0.2)"; // ctx.fillStyle = "rgba(0,0,0,0.2)";
// ctx.fillRect((pos_x + values[0].left)/Store.zoomRatio, (pos_y+values[0].top-values[0].asc)/Store.zoomRatio, textInfo.textWidthAll, textInfo.textHeightAll) // ctx.fillRect((pos_x + values[0].left)/Store.zoomRatio, (pos_y+values[0].top-values[0].asc)/Store.zoomRatio, textInfo.textWidthAll, textInfo.textHeightAll)

1449
src/global/getRowlen.js

File diff suppressed because it is too large

3
src/index.html

@ -77,7 +77,8 @@
allowEdit:true, allowEdit:true,
forceCalculation:false, forceCalculation:false,
plugins: ['chart'], plugins: ['chart'],
data: [sheetCell,sheetFormula,sheetConditionFormat,sheetSparkline,sheetTable,sheetComment,sheetPivotTableData,sheetPivotTable,sheetChart] data:
[sheetCell,sheetFormula,sheetConditionFormat,sheetSparkline,sheetTable,sheetComment,sheetPivotTableData,sheetPivotTable,sheetChart]
}) })
}) })

Loading…
Cancel
Save