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
f24fdc10
Commit
f24fdc10
authored
Jan 10, 2024
by
Ramdayal Munda
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
text border fix
parent
2d66b649
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
11 deletions
+8
-11
a-doc-editor2.js
dist/assets/a-doc-editor2.js
+8
-11
No files found.
dist/assets/a-doc-editor2.js
View file @
f24fdc10
...
@@ -14,7 +14,7 @@ var ADocEditor = function (customConfig) {
...
@@ -14,7 +14,7 @@ var ADocEditor = function (customConfig) {
tabWidth
:
20
,
// mm
tabWidth
:
20
,
// mm
},
},
style
:
{
style
:
{
fontSize
:
16
,
// this is in mm
fontSize
:
20
,
// this is in mm
fontFamily
:
'Calibri'
,
fontFamily
:
'Calibri'
,
bold
:
false
,
bold
:
false
,
italic
:
false
,
italic
:
false
,
...
@@ -230,9 +230,11 @@ var ADocEditor = function (customConfig) {
...
@@ -230,9 +230,11 @@ var ADocEditor = function (customConfig) {
let
wordEndIndex
=
0
;
// this stores the index of the word which can fit in the line;
let
wordEndIndex
=
0
;
// this stores the index of the word which can fit in the line;
for
(
c
=
0
;
c
<
dataBlock
.
plainContent
.
length
;
c
++
)
{
for
(
c
=
0
;
c
<
dataBlock
.
plainContent
.
length
;
c
++
)
{
let
style
=
dataBlock
?.
formatedText
?.[
c
]
let
style
=
dataBlock
?.
formatedText
?.[
c
]
let
isBlankChar
=
false
if
(
/
\s
/
.
test
(
dataBlock
.
plainContent
[
c
]))
{
if
(
/
\s
/
.
test
(
dataBlock
.
plainContent
[
c
]))
{
wordEndIndex
=
c
wordEndIndex
=
c
lineObj
.
charEndIndex
=
c
lineObj
.
charEndIndex
=
c
isBlankChar
=
true
}
}
let
charWidth
=
getCharacterWidth
(
dataBlock
.
plainContent
[
c
],
style
)
let
charWidth
=
getCharacterWidth
(
dataBlock
.
plainContent
[
c
],
style
)
dataBlock
.
formatedText
[
c
]
=
{
dataBlock
.
formatedText
[
c
]
=
{
...
@@ -240,21 +242,19 @@ var ADocEditor = function (customConfig) {
...
@@ -240,21 +242,19 @@ var ADocEditor = function (customConfig) {
...
style
,
...
style
,
width
:
charWidth
width
:
charWidth
}
}
tempLineWidth
+=
charWidth
if
(
tempLineWidth
+
charWidth
>
maxLineWidth
)
{
if
(
tempLineWidth
>
maxLineWidth
)
{
// cannot add this// new line should be added//
// cannot add this// new line should be added//
i
=
wordEndIndex
;
i
=
wordEndIndex
;
lineObj
.
plainContent
=
dataBlock
.
plainContent
.
slice
(
lineObj
.
charStartIndex
,
lineObj
.
charEndIndex
+
1
)
lineObj
.
plainContent
=
dataBlock
.
plainContent
.
slice
(
lineObj
.
charStartIndex
,
lineObj
.
charEndIndex
+
1
)
lines
.
push
(
lineObj
)
lines
.
push
(
lineObj
)
lineObj
=
new
getLineObj
()
lineObj
=
new
getLineObj
()
lineObj
.
listIndex
=
dataBlock
.
listIndex
lineObj
.
listIndex
=
dataBlock
.
listIndex
lineObj
.
maxLineWidth
=
maxLineWidth
lineObj
.
maxLineWidth
=
maxLineWidth
lineObj
.
tabCount
=
dataBlock
.
tabCount
lineObj
.
tabCount
=
dataBlock
.
tabCount
lineObj
.
charStartIndex
=
i
lineObj
.
charStartIndex
=
i
+
1
lineObj
.
charEndIndex
=
i
lineObj
.
charEndIndex
=
i
+
1
tempLineWidth
=
0
tempLineWidth
=
0
}
}
else
tempLineWidth
+=
charWidth
}
}
...
@@ -267,9 +267,6 @@ var ADocEditor = function (customConfig) {
...
@@ -267,9 +267,6 @@ var ADocEditor = function (customConfig) {
lines
.
push
(
lineObj
)
lines
.
push
(
lineObj
)
ctx
.
restore
()
ctx
.
restore
()
}
}
return
return
...
...
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