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
Hide 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 @@
...
@@ -1169,13 +1169,6 @@
canExpH
=
this
.
_expandHeight
();
canExpH
=
this
.
_expandHeight
();
doAjust
=
true
;
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
)
{
if
(
doAjust
)
{
this
.
_adjustCanvas
();
this
.
_adjustCanvas
();
...
@@ -1328,16 +1321,16 @@
...
@@ -1328,16 +1321,16 @@
}
}
};
};
CellEditor
.
prototype
.
_renderText
=
function
(
dy
)
{
CellEditor
.
prototype
.
_renderText
=
function
(
dy
)
{
var
t
=
this
,
opt
=
t
.
options
,
ctx
=
t
.
drawingCtx
;
var
t
=
this
,
opt
=
t
.
options
,
ctx
=
t
.
drawingCtx
;
if
(
!
window
[
'
IS_NATIVE_EDITOR
'
]
)
{
if
(
!
window
[
'
IS_NATIVE_EDITOR
'
]
)
{
ctx
.
setFillStyle
(
opt
.
background
)
ctx
.
setFillStyle
(
opt
.
background
)
.
fillRect
(
0
,
0
,
ctx
.
getWidth
(),
ctx
.
getHeight
()
);
.
fillRect
(
0
,
0
,
ctx
.
getWidth
(),
ctx
.
getHeight
()
);
}
}
if
(
opt
.
fragments
.
length
>
0
)
{
if
(
opt
.
fragments
.
length
>
0
)
{
t
.
textRender
.
render
(
t
.
_getContentLeft
(),
(
dy
===
undefined
?
0
:
dy
),
t
.
_getContentWidth
(),
opt
.
textColor
);
t
.
textRender
.
render
(
t
.
_getContentLeft
(),
dy
||
0
,
t
.
_getContentWidth
(),
opt
.
textColor
);
}
}
};
};
...
...
cell/view/CellTextRender.js
View file @
f38c35c7
...
@@ -208,14 +208,6 @@
...
@@ -208,14 +208,6 @@
}
}
co
=
this
.
charOffset
(
pos
,
i
-
1
,
h
);
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
;
return
co
;
};
};
...
@@ -240,10 +232,6 @@
...
@@ -240,10 +232,6 @@
return
this
.
charWidths
[
pos
];
return
this
.
charWidths
[
pos
];
};
};
CellTextRender
.
prototype
.
isLastCharNL
=
function
()
{
return
this
.
charWidths
[
this
.
chars
.
length
-
1
]
===
0
;
};
//------------------------------------------------------------export---------------------------------------------------
//------------------------------------------------------------export---------------------------------------------------
window
[
'
AscCommonExcel
'
]
=
window
[
'
AscCommonExcel
'
]
||
{};
window
[
'
AscCommonExcel
'
]
=
window
[
'
AscCommonExcel
'
]
||
{};
...
...
cell/view/StringRender.js
View file @
f38c35c7
...
@@ -648,13 +648,13 @@
...
@@ -648,13 +648,13 @@
*/
*/
StringRender
.
prototype
.
_calcTextMetrics
=
function
(
dontCalcRepeatChars
)
{
StringRender
.
prototype
.
_calcTextMetrics
=
function
(
dontCalcRepeatChars
)
{
var
self
=
this
,
i
=
0
,
p
,
p_
,
lm
,
beg
=
0
;
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
)
{
function
addLine
(
b
,
e
)
{
if
(
-
1
!==
b
)
if
(
-
1
!==
b
)
l
.
tw
+=
self
.
_calcLineWidth
(
b
,
e
-
1
);
l
.
tw
+=
self
.
_calcLineWidth
(
b
,
e
);
l
.
beg
=
b
;
l
.
beg
=
b
;
l
.
end
=
e
-
1
;
l
.
end
=
e
;
self
.
lines
.
push
(
l
);
self
.
lines
.
push
(
l
);
if
(
TW
<
l
.
tw
)
{
TW
=
l
.
tw
;}
if
(
TW
<
l
.
tw
)
{
TW
=
l
.
tw
;}
BL
=
TH
+
l
.
bl
;
BL
=
TH
+
l
.
bl
;
...
@@ -696,21 +696,17 @@
...
@@ -696,21 +696,17 @@
// process 'new line' marker
// process 'new line' marker
if
(
p
&&
(
p
.
nl
||
p
.
hp
))
{
if
(
p
&&
(
p
.
nl
||
p
.
hp
))
{
addLine
(
beg
,
i
);
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
);
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
);
l
=
new
LineInfo
(
0
,
lm
.
th
,
lm
.
bl
,
lm
.
a
,
lm
.
d
);
}
}
}
}
if
(
beg
<=
i
)
{
// add last line of text
addLine
(
beg
,
i
-
1
);
}
}
}
return
new
asc
.
TextMetrics
(
TW
,
TH
,
0
,
BL
,
0
,
0
,
(
this
.
lines
[
0
].
bl
-
this
.
lines
[
0
].
a
+
BL
+
l
.
d
)
/
2
);
if
(
beg
<
i
)
{
// add last line of text
addLine
(
beg
,
i
);
}
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
);
};
};
StringRender
.
prototype
.
_getRepeatCharPos
=
function
()
{
StringRender
.
prototype
.
_getRepeatCharPos
=
function
()
{
...
@@ -836,7 +832,7 @@
...
@@ -836,7 +832,7 @@
if
(
isNL
)
{
if
(
isNL
)
{
// add new line marker
// add new line marker
nlPos
=
chPos
+
1
;
nlPos
=
chPos
;
self
.
_getCharPropAt
(
nlPos
).
nl
=
true
;
self
.
_getCharPropAt
(
nlPos
).
nl
=
true
;
self
.
_getCharPropAt
(
nlPos
).
delta
=
delta
;
self
.
_getCharPropAt
(
nlPos
).
delta
=
delta
;
ch
=
"
"
;
ch
=
"
"
;
...
@@ -1067,6 +1063,9 @@
...
@@ -1067,6 +1063,9 @@
x1
+=
renderFragment
(
strBeg
,
i
,
p_
,
this
.
angle
);
x1
+=
renderFragment
(
strBeg
,
i
,
p_
,
this
.
angle
);
strBeg
=
i
;
strBeg
=
i
;
}
}
if
(
p
.
nl
)
{
strBeg
+=
1
;
}
if
(
p
.
font
)
{
if
(
p
.
font
)
{
// change canvas font style
// 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