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
4a06aca1
Commit
4a06aca1
authored
Jan 04, 2015
by
techird
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
支持 `node.getRenderBox(rendererType)` 获取指定渲染器渲染盒子大小
parent
e6868f77
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
render.js
src/core/render.js
+7
-0
No files found.
src/core/render.js
View file @
4a06aca1
...
@@ -124,6 +124,7 @@ define(function(require, exports, module) {
...
@@ -124,6 +124,7 @@ define(function(require, exports, module) {
// 合并盒子
// 合并盒子
if
(
lastBoxes
[
j
])
{
if
(
lastBoxes
[
j
])
{
node
.
_contentBox
=
node
.
_contentBox
.
merge
(
lastBoxes
[
j
]);
node
.
_contentBox
=
node
.
_contentBox
.
merge
(
lastBoxes
[
j
]);
renderer
.
contentBox
=
lastBoxes
[
j
];
}
}
// 判断当前上下文是否应该渲染
// 判断当前上下文是否应该渲染
...
@@ -201,6 +202,7 @@ define(function(require, exports, module) {
...
@@ -201,6 +202,7 @@ define(function(require, exports, module) {
// 合并渲染区域
// 合并渲染区域
if
(
latestBox
)
{
if
(
latestBox
)
{
node
.
_contentBox
=
node
.
_contentBox
.
merge
(
latestBox
);
node
.
_contentBox
=
node
.
_contentBox
.
merge
(
latestBox
);
renderer
.
contentBox
=
latestBox
;
}
}
}
}
...
@@ -245,6 +247,11 @@ define(function(require, exports, module) {
...
@@ -245,6 +247,11 @@ define(function(require, exports, module) {
getContentBox
:
function
()
{
getContentBox
:
function
()
{
//if (!this._contentBox) this.render();
//if (!this._contentBox) this.render();
return
this
.
parent
&&
this
.
parent
.
isCollapsed
()
?
new
kity
.
Box
()
:
(
this
.
_contentBox
||
new
kity
.
Box
());
return
this
.
parent
&&
this
.
parent
.
isCollapsed
()
?
new
kity
.
Box
()
:
(
this
.
_contentBox
||
new
kity
.
Box
());
},
getRenderBox
:
function
(
rendererType
,
refer
)
{
var
contentBox
=
rendererType
?
this
.
getRenderer
(
rendererType
).
contentBox
:
this
.
getContentBox
();
var
ctm
=
kity
.
Matrix
.
getCTM
(
this
.
getRenderContainer
(),
refer
||
'paper'
);
return
ctm
.
transformBox
(
contentBox
);
}
}
});
});
...
...
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