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
bbdc42b0
Commit
bbdc42b0
authored
Jul 24, 2014
by
techird
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
text render bug fixed
parent
3a6e745e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
9 deletions
+12
-9
text.js
src/module/text.js
+1
-1
zoom.js
src/module/zoom.js
+11
-8
No files found.
src/module/text.js
View file @
bbdc42b0
...
...
@@ -7,7 +7,7 @@ var TextRenderer = KityMinder.TextRenderer = kity.createClass('TextRenderer', {
return
new
kity
.
Text
()
.
setId
(
KityMinder
.
uuid
(
'node_text'
))
.
setVerticalAlign
(
'middle'
)
.
setAttr
(
'text-rendering'
,
'
defaul
t'
);
.
setAttr
(
'text-rendering'
,
'
inheri
t'
);
},
update
:
function
(
text
,
node
)
{
...
...
src/module/zoom.js
View file @
bbdc42b0
...
...
@@ -5,6 +5,11 @@ KityMinder.registerModule('Zoom', function() {
me
.
setDefaultOptions
(
'zoom'
,
[
10
,
20
,
30
,
50
,
80
,
100
,
120
,
150
,
200
]);
function
setTextRendering
()
{
var
value
=
me
.
_zoomValue
>=
100
?
'optimize-speed'
:
'geometricPrecision'
;
me
.
getRenderContainer
().
setAttr
(
'text-rendering'
,
value
);
}
function
fixPaperCTM
(
paper
)
{
var
node
=
paper
.
shapeNode
;
var
ctm
=
node
.
getCTM
();
...
...
@@ -23,6 +28,9 @@ KityMinder.registerModule('Zoom', function() {
};
paper
.
setViewPort
(
viewport
);
if
(
value
==
100
)
fixPaperCTM
(
paper
);
},
getZoomValue
:
function
()
{
return
this
.
_zoomValue
;
}
});
...
...
@@ -43,14 +51,8 @@ KityMinder.registerModule('Zoom', function() {
if
(
timeline
)
{
timeline
.
pause
();
}
function
setTextRendering
(
value
)
{
minder
.
getRoot
().
traverse
(
function
(
node
)
{
node
.
getTextShape
().
setAttr
(
'text-rendering'
,
value
);
});
}
setTextRendering
(
value
>=
100
?
'optimize-speed'
:
'geometricPrecision'
);
timeline
=
animator
.
start
(
minder
,
300
,
'easeInOutSine'
,
function
()
{
});
setTextRendering
();
timeline
=
animator
.
start
(
minder
,
300
,
'easeInOutSine'
,
function
()
{});
}
var
ZoomCommand
=
kity
.
createClass
(
'Zoom'
,
{
...
...
@@ -102,6 +104,7 @@ KityMinder.registerModule('Zoom', function() {
return
{
init
:
function
()
{
this
.
_zoomValue
=
100
;
setTextRendering
();
},
commands
:
{
'zoom-in'
:
ZoomInCommand
,
...
...
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