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
aafe8014
Commit
aafe8014
authored
Oct 20, 2015
by
张博
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add tianpan template outline and text
parent
322eb8ec
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
6 deletions
+38
-6
outline.js
src/module/outline.js
+31
-5
text.js
src/module/text.js
+7
-1
No files found.
src/module/outline.js
View file @
aafe8014
...
...
@@ -23,6 +23,8 @@ define(function(require, exports, module) {
update
:
function
(
outline
,
node
,
box
)
{
var
shape
=
node
.
getStyle
(
'shape'
);
var
paddingLeft
=
node
.
getStyle
(
'padding-left'
),
paddingRight
=
node
.
getStyle
(
'padding-right'
),
paddingTop
=
node
.
getStyle
(
'padding-top'
),
...
...
@@ -35,14 +37,29 @@ define(function(require, exports, module) {
height
:
box
.
height
+
paddingTop
+
paddingBottom
};
var
radius
=
node
.
getStyle
(
'radius'
);
// 天盘图圆形的情况
if
(
shape
&&
shape
==
'circle'
)
{
var
width
=
Math
.
max
(
box
.
width
,
box
.
height
);
outlineBox
.
width
=
width
+
paddingLeft
+
paddingRight
;
outlineBox
.
height
=
width
+
paddingTop
+
paddingBottom
;
outlineBox
.
width
=
Math
.
max
(
outlineBox
.
width
,
outlineBox
.
height
);
outlineBox
.
height
=
Math
.
max
(
outlineBox
.
width
,
outlineBox
.
height
);
radius
=
outlineBox
.
width
/
2
;
}
var
prefix
=
node
.
isSelected
()
?
(
node
.
getMinder
().
isFocused
()
?
'selected-'
:
'blur-selected-'
)
:
''
;
outline
.
setPosition
(
outlineBox
.
x
,
outlineBox
.
y
)
.
setSize
(
outlineBox
.
width
,
outlineBox
.
height
)
.
setRadius
(
node
.
getStyle
(
'radius'
)
)
.
setRadius
(
radius
)
.
fill
(
node
.
getData
(
'background'
)
||
node
.
getStyle
(
prefix
+
'background'
)
||
node
.
getStyle
(
'background'
))
.
stroke
(
node
.
getStyle
(
prefix
+
'stroke'
||
node
.
getStyle
(
'stroke'
)),
node
.
getStyle
(
prefix
+
'stroke-width'
));
node
.
getStyle
(
prefix
+
'stroke-width'
));
return
new
kity
.
Box
(
outlineBox
);
}
...
...
@@ -62,9 +79,18 @@ define(function(require, exports, module) {
update
:
function
(
shadow
,
node
,
box
)
{
shadow
.
setPosition
(
box
.
x
+
4
,
box
.
y
+
5
)
.
setSize
(
box
.
width
,
box
.
height
)
.
fill
(
node
.
getStyle
(
'shadow'
))
.
setRadius
(
node
.
getStyle
(
'radius'
));
.
fill
(
node
.
getStyle
(
'shadow'
));
var
shape
=
node
.
getStyle
(
'shape'
);
if
(
!
shape
){
shadow
.
setSize
(
box
.
width
,
box
.
height
);
shadow
.
setRadius
(
node
.
getStyle
(
'radius'
));
}
else
if
(
shape
==
'circle'
){
var
width
=
Math
.
max
(
box
.
width
,
box
.
height
);
shadow
.
setSize
(
width
,
width
);
shadow
.
setRadius
(
width
/
2
);
}
}
});
...
...
src/module/text.js
View file @
aafe8014
...
...
@@ -226,7 +226,13 @@ define(function(require, exports, module) {
rBox
=
rBox
.
merge
(
new
kity
.
Box
(
0
,
y
,
bbox
.
height
&&
bbox
.
width
||
1
,
fontSize
));
});
var
nBox
=
new
kity
.
Box
(
r
(
rBox
.
x
),
r
(
rBox
.
y
),
r
(
rBox
.
width
),
r
(
rBox
.
height
));
//为了让文字在圆中垂直居中
var
w
=
0
;
var
shape
=
node
.
getStyle
(
'shape'
);
if
(
shape
&&
shape
==
'circle'
){
w
=
Math
.
max
(
rBox
.
width
,
rBox
.
height
)
/
2
-
rBox
.
height
/
2
;
}
var
nBox
=
new
kity
.
Box
(
r
(
rBox
.
x
),
r
(
rBox
.
y
-
w
),
r
(
rBox
.
width
),
r
(
rBox
.
height
));
node
.
_currentTextGroupBox
=
nBox
;
return
nBox
;
...
...
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