Skip to content
This repository has been archived by the owner on Mar 28, 2024. It is now read-only.

Commit

Permalink
fix(rotate text position mistake, when sheet zoom): fix zoom bug, fix…
Browse files Browse the repository at this point in the history
… strike and underline bug
  • Loading branch information
tubiaoge committed Sep 26, 2020
1 parent 09a3de5 commit 6680a13
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 44 deletions.
8 changes: 4 additions & 4 deletions src/global/draw.js
Original file line number Diff line number Diff line change
Expand Up @@ -2140,9 +2140,9 @@ function cellTextRender(textInfo, ctx, option){

if(textInfo.rotate!=0 && textInfo.type!="verticalWrap"){
ctx.save();
ctx.translate(pos_x+textInfo.textLeftAll, pos_y+textInfo.textTopAll);
ctx.translate((pos_x+textInfo.textLeftAll)/Store.zoomRatio, (pos_y+textInfo.textTopAll)/Store.zoomRatio);
ctx.rotate(-textInfo.rotate * Math.PI / 180);
ctx.translate(-(textInfo.textLeftAll+pos_x), -(pos_y+textInfo.textTopAll));
ctx.translate(-(textInfo.textLeftAll+pos_x)/Store.zoomRatio, -(pos_y+textInfo.textTopAll)/Store.zoomRatio);
}

// ctx.fillStyle = "rgb(0,0,0)";
Expand All @@ -2169,7 +2169,7 @@ function cellTextRender(textInfo, ctx, option){
Math.floor((pos_x +c.endX)/Store.zoomRatio)+0.5 ,
Math.floor((pos_y+c.endY)/Store.zoomRatio)+0.5 ,
);
ctx.lineWidth = 1;
ctx.lineWidth = Math.floor(c.fs/9);
ctx.strokeStyle = ctx.fillStyle;
ctx.stroke();
ctx.closePath();
Expand All @@ -2188,7 +2188,7 @@ function cellTextRender(textInfo, ctx, option){
Math.floor((pos_x +item.endX)/Store.zoomRatio)+0.5,
Math.floor((pos_y+ item.endY)/Store.zoomRatio)+0.5
);
ctx.lineWidth = 1;
ctx.lineWidth = Math.floor(item.fs/9);
ctx.strokeStyle = ctx.fillStyle;
ctx.stroke();
ctx.closePath();
Expand Down
80 changes: 40 additions & 40 deletions src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -81,46 +81,46 @@
forceCalculation:false,
plugins: ['chart'],
data:
[sheetCell,sheetFormula,sheetConditionFormat,sheetSparkline,sheetTable,sheetComment,sheetPivotTableData,sheetPivotTable,sheetChart,sheetPicture,sheetDataVerification]
// [{"name":"Sheet1","config":{"columnlen":{"0":241},"rowlen":{"0":81}},"index":"1","status":"1","order":"0","luckysheet_select_save":[{"row":[0,0],"column":[4,4],"sheetIndex":1}],"zoomRatio":1,"showGridLines":"1","defaultColWidth":72,"defaultRowHeight":18,"celldata":[
// {"r":0,"c":0,
// "v":{
// "ct":{
// "fa":"General",
// "t":"inlineStr",
// "s":[
// {
// "ff":"Arial", //font family
// "fc":"#fff000",//font color
// "fs":12,//font size
// "cl":0,//strike
// "un":0,//underline
// "bl":0,//blod
// "it":0,//italic
// v:"我在马路\r\n边捡到\r\n\r\n一分钱"
// },
// {
// "ff":"Arial", //font family
// "fc":"#ff0000",//font color
// "fs":14,//font size
// "cl":"1",//strike
// "un":"1",//underline
// "bl":"1",//blod
// "it":"0",//italic
// v:"交给警\r\n察叔叔\r\n"
// },
// ]
// },
// "fs":11,
// "ff":"等线",
// "vt":0,
// "tb":2,
// "v":"",
// "qp":1,
// }
// },
// {"r":17,"c":2,"v":{"v":"Luckysheet","ct":{"fa":"General","t":"g"},"bg":null,"bl":0,"it":0,"ff":0,"fs":"11","fc":"rgb(51, 51, 51)","ht":1,"vt":1,"m":"Luckysheet"}}
// ],"calcChain":[]}]
// [sheetCell,sheetFormula,sheetConditionFormat,sheetSparkline,sheetTable,sheetComment,sheetPivotTableData,sheetPivotTable,sheetChart,sheetPicture,sheetDataVerification]
[{"name":"Sheet1","config":{"columnlen":{"0":241},"rowlen":{"0":81}},"index":"1","status":"1","order":"0","luckysheet_select_save":[{"row":[0,0],"column":[4,4],"sheetIndex":1}],"zoomRatio":1,"showGridLines":"1","defaultColWidth":72,"defaultRowHeight":18,"celldata":[
{"r":0,"c":0,
"v":{
"ct":{
"fa":"General",
"t":"inlineStr",
"s":[
{
"ff":"Arial", //font family
"fc":"#fff000",//font color
"fs":12,//font size
"cl":0,//strike
"un":0,//underline
"bl":0,//blod
"it":0,//italic
v:"我在马路\r\n边捡到\r\n\r\n一分钱"
},
{
"ff":"Arial", //font family
"fc":"#ff0000",//font color
"fs":14,//font size
"cl":"1",//strike
"un":"1",//underline
"bl":"1",//blod
"it":"0",//italic
v:"交给警\r\n察叔叔\r\n"
},
]
},
"fs":11,
"ff":"等线",
"vt":0,
"tb":2,
"v":"",
"qp":1,
}
},
{"r":17,"c":2,"v":{"v":"Luckysheet","ct":{"fa":"General","t":"g"},"bg":null,"bl":0,"it":0,"ff":0,"fs":"11","fc":"rgb(51, 51, 51)","ht":1,"vt":1,"m":"Luckysheet"}}
],"calcChain":[]}]
})

})
Expand Down

0 comments on commit 6680a13

Please sign in to comment.