Commit a83bdb6a by ramdayalmunda

care position fix 2

parent babead2c
......@@ -258,6 +258,7 @@ var ADocEditor = function (customConfig) {
renderCaret(true)
function calculateTextSizeAndPosition() {
console.clear()
let d = 0, c = 0;
function getLineObj() {
let newLineObj = {
......@@ -341,6 +342,7 @@ var ADocEditor = function (customConfig) {
lineObj = new getLineObj()
maxLineWidth = config.pageSetup.pxWidth - (config.format.margin * pxMmRatio * 2)
lineObj.maxLineWidth = maxLineWidth
lineObj.maxFontSize = style.fontSize
if (dataBlock.type == 1) lineObj.tabWidth = tabWidth
else lineObj.tabWidth = 0
if (dataBlock.type == 1) lineObj.tabCount = dataBlock.tabCount
......@@ -778,7 +780,9 @@ var ADocEditor = function (customConfig) {
let charData = caretData.activeData.formatedText[caretData.index - 1]
if (lineObj) {
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