Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sdkjs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
sdkjs
Commits
f38c35c7
Commit
f38c35c7
authored
Dec 07, 2016
by
Alexander.Trofimov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bug 33626
🐛
parent
7d269741
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
39 deletions
+19
-39
cell/view/CellEditorView.js
cell/view/CellEditorView.js
+6
-13
cell/view/CellTextRender.js
cell/view/CellTextRender.js
+0
-12
cell/view/StringRender.js
cell/view/StringRender.js
+13
-14
No files found.
cell/view/CellEditorView.js
View file @
f38c35c7
...
...
@@ -1169,13 +1169,6 @@
canExpH
=
this
.
_expandHeight
();
doAjust
=
true
;
}
if
(
this
.
textRender
.
isLastCharNL
()
&&
!
doAjust
&&
canExpH
)
{
var
lm
=
this
.
textRender
.
calcCharHeight
(
this
.
textRender
.
getCharsCount
()
-
1
);
if
(
tm
.
height
+
lm
.
th
>
this
.
_getContentHeight
())
{
this
.
_expandHeight
();
doAjust
=
true
;
}
}
}
if
(
doAjust
)
{
this
.
_adjustCanvas
();
...
...
@@ -1328,16 +1321,16 @@
}
};
CellEditor
.
prototype
.
_renderText
=
function
(
dy
)
{
CellEditor
.
prototype
.
_renderText
=
function
(
dy
)
{
var
t
=
this
,
opt
=
t
.
options
,
ctx
=
t
.
drawingCtx
;
if
(
!
window
[
'
IS_NATIVE_EDITOR
'
]
)
{
ctx
.
setFillStyle
(
opt
.
background
)
.
fillRect
(
0
,
0
,
ctx
.
getWidth
(),
ctx
.
getHeight
()
);
if
(
!
window
[
'
IS_NATIVE_EDITOR
'
]
)
{
ctx
.
setFillStyle
(
opt
.
background
)
.
fillRect
(
0
,
0
,
ctx
.
getWidth
(),
ctx
.
getHeight
()
);
}
if
(
opt
.
fragments
.
length
>
0
)
{
t
.
textRender
.
render
(
t
.
_getContentLeft
(),
(
dy
===
undefined
?
0
:
dy
),
t
.
_getContentWidth
(),
opt
.
textColor
);
if
(
opt
.
fragments
.
length
>
0
)
{
t
.
textRender
.
render
(
t
.
_getContentLeft
(),
dy
||
0
,
t
.
_getContentWidth
(),
opt
.
textColor
);
}
};
...
...
cell/view/CellTextRender.js
View file @
f38c35c7
...
...
@@ -208,14 +208,6 @@
}
co
=
this
.
charOffset
(
pos
,
i
-
1
,
h
);
// если самый последний символ - это новая строка, то надо сместить еще на одну линию
if
(
t
.
charWidths
[
t
.
chars
.
length
-
1
]
===
0
)
{
co
.
left
=
null
;
co
.
top
+=
l
[
i
-
1
].
th
;
co
.
lineIndex
++
;
}
return
co
;
};
...
...
@@ -240,10 +232,6 @@
return
this
.
charWidths
[
pos
];
};
CellTextRender
.
prototype
.
isLastCharNL
=
function
()
{
return
this
.
charWidths
[
this
.
chars
.
length
-
1
]
===
0
;
};
//------------------------------------------------------------export---------------------------------------------------
window
[
'
AscCommonExcel
'
]
=
window
[
'
AscCommonExcel
'
]
||
{};
...
...
cell/view/StringRender.js
View file @
f38c35c7
...
...
@@ -648,13 +648,13 @@
*/
StringRender
.
prototype
.
_calcTextMetrics
=
function
(
dontCalcRepeatChars
)
{
var
self
=
this
,
i
=
0
,
p
,
p_
,
lm
,
beg
=
0
;
var
l
=
new
LineInfo
(),
TW
=
0
,
TH
=
0
,
BL
=
0
,
CL
=
0
;
var
l
=
new
LineInfo
(),
TW
=
0
,
TH
=
0
,
BL
=
0
;
function
addLine
(
b
,
e
)
{
if
(
-
1
!==
b
)
l
.
tw
+=
self
.
_calcLineWidth
(
b
,
e
-
1
);
l
.
tw
+=
self
.
_calcLineWidth
(
b
,
e
);
l
.
beg
=
b
;
l
.
end
=
e
-
1
;
l
.
end
=
e
;
self
.
lines
.
push
(
l
);
if
(
TW
<
l
.
tw
)
{
TW
=
l
.
tw
;}
BL
=
TH
+
l
.
bl
;
...
...
@@ -696,21 +696,17 @@
// process 'new line' marker
if
(
p
&&
(
p
.
nl
||
p
.
hp
))
{
addLine
(
beg
,
i
);
beg
=
i
;
beg
=
i
+
(
p
.
nl
?
1
:
0
)
;
lm
=
this
.
_calcLineMetrics
(
p_
.
fsz
!==
undefined
?
p_
.
fsz
:
p_
.
font
.
FontSize
,
p_
.
va
,
p_
.
fm
);
l
=
new
LineInfo
(
0
,
lm
.
th
,
lm
.
bl
,
lm
.
a
,
lm
.
d
);
}
}
}
if
(
beg
<
i
)
{
if
(
beg
<=
i
)
{
// add last line of text
addLine
(
beg
,
i
);
addLine
(
beg
,
i
-
1
);
}
if
(
this
.
lines
.
length
>
0
)
{
CL
=
(
this
.
lines
[
0
].
bl
-
this
.
lines
[
0
].
a
+
BL
+
l
.
d
)
/
2
;
}
return
new
asc
.
TextMetrics
(
TW
,
TH
,
0
,
BL
,
0
,
0
,
CL
);
return
new
asc
.
TextMetrics
(
TW
,
TH
,
0
,
BL
,
0
,
0
,
(
this
.
lines
[
0
].
bl
-
this
.
lines
[
0
].
a
+
BL
+
l
.
d
)
/
2
);
};
StringRender
.
prototype
.
_getRepeatCharPos
=
function
()
{
...
...
@@ -836,7 +832,7 @@
if
(
isNL
)
{
// add new line marker
nlPos
=
chPos
+
1
;
nlPos
=
chPos
;
self
.
_getCharPropAt
(
nlPos
).
nl
=
true
;
self
.
_getCharPropAt
(
nlPos
).
delta
=
delta
;
ch
=
"
"
;
...
...
@@ -1067,6 +1063,9 @@
x1
+=
renderFragment
(
strBeg
,
i
,
p_
,
this
.
angle
);
strBeg
=
i
;
}
if
(
p
.
nl
)
{
strBeg
+=
1
;
}
if
(
p
.
font
)
{
// change canvas font style
...
...
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