Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
a-doc-editor
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ramdayal Munda
a-doc-editor
Commits
05994aa9
Commit
05994aa9
authored
Nov 29, 2023
by
ramdayalmunda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
simple follow caret
parent
4a5400c4
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
a-doc-editor.js
dist/assets/a-doc-editor.js
+2
-2
No files found.
dist/assets/a-doc-editor.js
View file @
05994aa9
...
...
@@ -84,7 +84,6 @@ var ADocEditor = function (customConfig) {
if
(
dataList
[
i
].
id
==
caretData
.
activeData
.
id
)
{
caretData
.
canvasIndex
=
canvasIndex
caretData
=
{
...
caretData
,
...
calculateCaretPosition
()
}
}
}
...
...
@@ -94,7 +93,7 @@ var ADocEditor = function (customConfig) {
let
ctx
=
canvasList
[
caretData
.
canvasIndex
].
getContext
(
'2d'
,
{
willReadFrequently
:
true
})
let
rectX
=
caretData
.
x
;
let
rectY
=
caretData
.
y
-
caretData
.
caretSize
;
let
rectWidth
=
4
;
let
rectWidth
=
3
;
let
rectHeight
=
caretData
.
caretSize
;
const
imageData
=
ctx
.
getImageData
(
rectX
,
rectY
,
rectWidth
,
rectHeight
);
...
...
@@ -136,6 +135,7 @@ var ADocEditor = function (customConfig) {
let
fontFamily
=
"Arial"
ctx
.
font
=
`
${
fontSize
}
px
${
fontFamily
}
`
ctx
.
fillStyle
=
`#000`
caretData
.
x
=
ctx
.
measureText
(
dataSet
.
plainContent
).
width
ctx
.
fillText
(
dataSet
.
plainContent
,
0
,
fontSize
*
(
3
/
4
))
ctx
.
restore
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment