Commit 4a5400c4 by ramdayalmunda

minor position fixes

parent e825c35b
......@@ -29,6 +29,7 @@ var ADocEditor = function (customConfig) {
activeData: dataSet[0],
index: dataSet[0].plainContent.length,
interval: null,
intervalDuration: 800,
blink: false,
canvasIndex: 0,
caretSize: 28,
......@@ -57,7 +58,7 @@ var ADocEditor = function (customConfig) {
caretData.interval = setInterval(() => {
caretData.blink = !caretData.blink
reRenderPages(dataSet, true)
}, 1000)
}, caretData.intervalDuration)
}
function reRenderPages(dataList, blinking = false) {
......@@ -83,7 +84,7 @@ var ADocEditor = function (customConfig) {
if (dataList[i].id == caretData.activeData.id) {
caretData.canvasIndex = canvasIndex
calculateCaretPosition()
caretData = { ...caretData, ...calculateCaretPosition() }
}
}
......@@ -109,6 +110,13 @@ var ADocEditor = function (customConfig) {
}
}
function calculateCaretPosition() {
return {
x: 146,
y: 21
}
}
function createCanvas() {
let canvas = document.createElement('canvas')
canvas.width = config.pageSetup.canvasWidth
......@@ -151,15 +159,9 @@ var ADocEditor = function (customConfig) {
caretData.interval = setInterval(() => {
caretData.blink = !caretData.blink
reRenderPages(dataSet, true)
}, 1000)
}, caretData.intervalDuration)
}
function calculateCaretPosition() {
return {
x: 50,
y: 21
}
}
function mousedownHandler(e) {
e.target.focus({ preventScroll: true });
......
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