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
43530f71
Commit
43530f71
authored
May 11, 2017
by
SergeyLuzyanin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
connectors
parent
ffc22f45
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
140 additions
and
28 deletions
+140
-28
common/Drawings/Format/CnxShape.js
common/Drawings/Format/CnxShape.js
+98
-22
common/Drawings/Format/Geometry.js
common/Drawings/Format/Geometry.js
+1
-1
common/Drawings/Format/Shape.js
common/Drawings/Format/Shape.js
+1
-0
common/Drawings/TrackObjects/NewShapeTracks.js
common/Drawings/TrackObjects/NewShapeTracks.js
+40
-5
No files found.
common/Drawings/Format/CnxShape.js
View file @
43530f71
This diff is collapsed.
Click to expand it.
common/Drawings/Format/Geometry.js
View file @
43530f71
...
...
@@ -1087,7 +1087,7 @@ Geometry.prototype=
if
(
Math
.
sqrt
(
dx
*
dx
+
dy
*
dy
)
<
distanse
)
{
return
{
ang
:
this
.
cnxLst
[
i
].
ang
,
x
:
this
.
cnxLst
[
i
].
x
,
y
:
this
.
cnxLst
[
i
].
y
};
return
{
idx
:
i
,
ang
:
this
.
cnxLst
[
i
].
ang
,
x
:
this
.
cnxLst
[
i
].
x
,
y
:
this
.
cnxLst
[
i
].
y
};
}
}
return
null
;
...
...
common/Drawings/Format/Shape.js
View file @
43530f71
...
...
@@ -5390,6 +5390,7 @@ CShape.prototype.getColumnNumber = function(){
_ret
.
x
=
oTransform
.
TransformPointX
(
oConnectorInfo
.
x
,
oConnectorInfo
.
y
);
_ret
.
y
=
oTransform
.
TransformPointY
(
oConnectorInfo
.
x
,
oConnectorInfo
.
y
);
_ret
.
bounds
.
fromOther
(
this
.
bounds
);
_ret
.
idx
=
oConnectorInfo
.
idx
;
return
_ret
;
};
...
...
common/Drawings/TrackObjects/NewShapeTracks.js
View file @
43530f71
...
...
@@ -131,6 +131,10 @@ function NewShapeTrack(presetGeom, startX, startY, theme, master, layout, slide,
this
.
oShapeDrawConnectors
=
null
;
this
.
lastSpPr
=
null
;
this
.
startShape
=
null
;
this
.
endShape
=
null
;
this
.
endConnectionInfo
=
null
;
AscFormat
.
ExecuteNoHistory
(
function
(){
if
(
slide
){
...
...
@@ -144,6 +148,7 @@ function NewShapeTrack(presetGeom, startX, startY, theme, master, layout, slide,
this
.
startConnectionInfo
=
oConnector
;
this
.
startX
=
oConnector
.
x
;
this
.
startY
=
oConnector
.
y
;
this
.
startShape
=
aSpTree
[
i
];
break
;
}
}
...
...
@@ -268,6 +273,9 @@ function NewShapeTrack(presetGeom, startX, startY, theme, master, layout, slide,
this
.
oShapeDrawConnectors
=
null
;
this
.
lastSpPr
=
null
;
this
.
endShape
=
null
;
this
.
endConnectionInfo
=
null
;
if
(
this
.
bConnector
){
var
aSpTree
=
slide
.
cSld
.
spTree
;
var
oConnector
=
null
;
...
...
@@ -277,6 +285,8 @@ function NewShapeTrack(presetGeom, startX, startY, theme, master, layout, slide,
if
(
oConnector
){
oEndConnectionInfo
=
oConnector
;
this
.
oShapeDrawConnectors
=
aSpTree
[
i
];
this
.
endShape
=
aSpTree
[
i
];
this
.
endConnectionInfo
=
oEndConnectionInfo
;
break
;
}
}
...
...
@@ -548,22 +558,47 @@ function NewShapeTrack(presetGeom, startX, startY, theme, master, layout, slide,
this
.
getShape
=
function
(
bFromWord
,
DrawingDocument
,
drawingObjects
)
{
var
shape
=
new
AscFormat
.
CShape
();
if
(
drawingObjects
)
{
shape
.
setDrawingObjects
(
drawingObjects
);
}
var
_sp_pr
;
if
(
this
.
lastSpPr
){
var
shape
=
new
AscFormat
.
CConnectionShape
();
if
(
drawingObjects
)
{
shape
.
setDrawingObjects
(
drawingObjects
);
}
_sp_pr
=
this
.
lastSpPr
.
createDuplicate
();
shape
.
setSpPr
(
_sp_pr
);
_sp_pr
.
setParent
(
shape
);
var
nv_sp_pr
=
new
AscFormat
.
UniNvPr
();
nv_sp_pr
.
cNvPr
.
setId
(
++
slide
.
maxId
);
shape
.
setNvSpPr
(
nv_sp_pr
);
var
nvUniSpPr
=
new
AscFormat
.
CNvUniSpPr
();
if
(
this
.
startShape
&&
this
.
startConnectionInfo
)
{
nvUniSpPr
.
stCnxIdx
=
this
.
startConnectionInfo
.
idx
;
nvUniSpPr
.
stCnxId
=
this
.
startShape
.
nvSpPr
.
cNvPr
.
id
;
}
if
(
this
.
endShape
&&
this
.
endConnectionInfo
)
{
nvUniSpPr
.
endCnxIdx
=
this
.
endConnectionInfo
.
idx
;
nvUniSpPr
.
endCnxId
=
this
.
endShape
.
nvSpPr
.
cNvPr
.
id
;
}
shape
.
nvSpPr
.
setUniSpPr
(
nvUniSpPr
);
}
else
{
var
shape
=
new
AscFormat
.
CShape
();
if
(
drawingObjects
)
{
shape
.
setDrawingObjects
(
drawingObjects
);
}
shape
.
setSpPr
(
new
AscFormat
.
CSpPr
());
shape
.
spPr
.
setParent
(
shape
);
if
(
bFromWord
)
...
...
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