Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
kityminder-core
Project
Project
Details
Activity
Releases
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
吴志俊
kityminder-core
Commits
5e60e28a
Commit
5e60e28a
authored
Oct 09, 2014
by
campaign
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复光标
parent
da286ad2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
19 deletions
+24
-19
editor.selection.js
src/module/editor.selection.js
+2
-2
text.js
src/module/text.js
+22
-17
No files found.
src/module/editor.selection.js
View file @
5e60e28a
...
@@ -45,7 +45,8 @@ Minder.Selection = kity.createClass( 'Selection', {
...
@@ -45,7 +45,8 @@ Minder.Selection = kity.createClass( 'Selection', {
if
(
i
===
0
||
cIndex
===
startOffset
){
if
(
i
===
0
||
cIndex
===
startOffset
){
tmpOffset
.
x
=
o
.
x
;
tmpOffset
.
x
=
o
.
x
;
tmpOffset
.
y
=
o
.
y
;
tmpOffset
.
y
=
o
.
y
;
tmpOffset
.
width
=
i
===
0
&&
offset
&&
offset
.
x
<=
o
.
x
&&
cIndex
!=
startOffset
?
0
:
o
.
width
;
tmpOffset
.
width
=
o
.
width
;
//i === 0 && offset && offset.x <= o.x && cIndex != startOffset ? 0 :
}
else
if
(
cIndex
<
endOffset
){
}
else
if
(
cIndex
<
endOffset
){
tmpOffset
.
width
+=
o
.
width
;
tmpOffset
.
width
+=
o
.
width
;
}
else
if
(
cIndex
===
endOffset
){
}
else
if
(
cIndex
===
endOffset
){
...
@@ -54,7 +55,6 @@ Minder.Selection = kity.createClass( 'Selection', {
...
@@ -54,7 +55,6 @@ Minder.Selection = kity.createClass( 'Selection', {
}
}
cIndex
++
;
cIndex
++
;
});
});
if
(
tmpOffset
.
x
!==
undefined
)
{
if
(
tmpOffset
.
x
!==
undefined
)
{
arrOffset
.
push
(
tmpOffset
);
arrOffset
.
push
(
tmpOffset
);
...
...
src/module/text.js
View file @
5e60e28a
...
@@ -38,29 +38,34 @@ var TextRenderer = KityMinder.TextRenderer = kity.createClass('TextRenderer', {
...
@@ -38,29 +38,34 @@ var TextRenderer = KityMinder.TextRenderer = kity.createClass('TextRenderer', {
this
.
setTextStyle
(
node
,
textGroup
);
this
.
setTextStyle
(
node
,
textGroup
);
for
(
var
i
=
0
,
text
,
textShape
;
var
textLength
=
textArr
.
length
;
(
text
=
textArr
[
i
],
textShape
=
textGroup
.
getItem
(
i
),
text
!==
undefined
||
textShape
!==
undefined
);
i
++
)
{
var
textGroupLength
=
textGroup
.
getItems
().
length
;
if
(
text
===
undefined
&&
textShape
)
{
if
(
textLength
<
textGroupLength
){
for
(
var
i
=
textLength
,
ci
;
ci
=
textGroup
.
getItem
(
i
);){
textGroup
.
removeItem
(
i
);
textGroup
.
removeItem
(
i
);
}
else
{
}
if
(
text
!==
undefined
&&
!
textShape
)
{
}
else
if
(
textLength
>
textGroupLength
)
{
textShape
=
new
kity
.
Text
()
var
length
=
textLength
-
textGroupLength
;
.
setAttr
(
'text-rendering'
,
'inherit'
);
for
(
var
i
=
0
;
i
<
length
;
i
++
){
if
(
kity
.
Browser
.
ie
)
{
var
textShape
=
new
kity
.
Text
()
textShape
.
setVerticalAlign
(
'top
'
);
.
setAttr
(
'text-rendering'
,
'inherit
'
);
}
else
{
if
(
kity
.
Browser
.
ie
)
{
textShape
.
setAttr
(
'dominant-baseline'
,
'text-before-edge
'
);
textShape
.
setVerticalAlign
(
'top
'
);
}
}
else
{
text
Group
.
addItem
(
textShape
);
text
Shape
.
setAttr
(
'dominant-baseline'
,
'text-before-edge'
);
}
}
textShape
.
setContent
(
text
);
textGroup
.
addItem
(
textShape
);
}
}
}
for
(
var
i
=
0
,
text
,
textShape
;
(
text
=
textArr
[
i
],
textShape
=
textGroup
.
getItem
(
i
));
i
++
)
{
textShape
.
setContent
(
text
);
}
}
this
.
setTextStyle
(
node
,
textGroup
);
this
.
setTextStyle
(
node
,
textGroup
);
return
function
()
{
return
function
()
{
...
...
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