Commit a83bdb6a by ramdayalmunda

care position fix 2

parent babead2c
...@@ -258,6 +258,7 @@ var ADocEditor = function (customConfig) { ...@@ -258,6 +258,7 @@ var ADocEditor = function (customConfig) {
renderCaret(true) renderCaret(true)
function calculateTextSizeAndPosition() { function calculateTextSizeAndPosition() {
console.clear()
let d = 0, c = 0; let d = 0, c = 0;
function getLineObj() { function getLineObj() {
let newLineObj = { let newLineObj = {
...@@ -341,6 +342,7 @@ var ADocEditor = function (customConfig) { ...@@ -341,6 +342,7 @@ var ADocEditor = function (customConfig) {
lineObj = new getLineObj() lineObj = new getLineObj()
maxLineWidth = config.pageSetup.pxWidth - (config.format.margin * pxMmRatio * 2) maxLineWidth = config.pageSetup.pxWidth - (config.format.margin * pxMmRatio * 2)
lineObj.maxLineWidth = maxLineWidth lineObj.maxLineWidth = maxLineWidth
lineObj.maxFontSize = style.fontSize
if (dataBlock.type == 1) lineObj.tabWidth = tabWidth if (dataBlock.type == 1) lineObj.tabWidth = tabWidth
else lineObj.tabWidth = 0 else lineObj.tabWidth = 0
if (dataBlock.type == 1) lineObj.tabCount = dataBlock.tabCount if (dataBlock.type == 1) lineObj.tabCount = dataBlock.tabCount
...@@ -778,7 +780,9 @@ var ADocEditor = function (customConfig) { ...@@ -778,7 +780,9 @@ var ADocEditor = function (customConfig) {
let charData = caretData.activeData.formatedText[caretData.index - 1] let charData = caretData.activeData.formatedText[caretData.index - 1]
if (lineObj) { if (lineObj) {
x = (charData?(charData.x+charData.width):x) x = (charData?(charData.x+charData.width):x)
y = lineObj.y-(lineObj.maxFontSize*pxMmRatio) if(charData)y = charData.y-(lineObj.maxFontSize*pxMmRatio)
else y = lineObj.y-(lineObj.maxFontSize*pxMmRatio)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment