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
59eaaa54
Commit
59eaaa54
authored
May 14, 2017
by
Sergey.Luzyanin
Committed by
Sergey.Luzyanin
May 14, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
draw connection points, when user adds connector;
fix bug in calculation connector's params;
parent
602cccbe
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
47 additions
and
2 deletions
+47
-2
common/Drawings/CommonController.js
common/Drawings/CommonController.js
+19
-0
common/Drawings/Format/CnxShape.js
common/Drawings/Format/CnxShape.js
+1
-1
common/Drawings/States.js
common/Drawings/States.js
+26
-0
common/Drawings/TrackObjects/NewShapeTracks.js
common/Drawings/TrackObjects/NewShapeTracks.js
+1
-1
No files found.
common/Drawings/CommonController.js
View file @
59eaaa54
...
...
@@ -676,6 +676,14 @@ function getTargetTextObject(controller)
return
null
;
}
function
isConnectorPreset
(
sPreset
){
if
(
typeof
sPreset
===
"
string
"
&&
sPreset
.
length
>
0
){
return
"
line
"
===
sPreset
||
sPreset
.
toLowerCase
().
indexOf
(
"
connector
"
)
>
-
1
;
}
return
false
;
}
function
DrawingObjectsController
(
drawingObjects
)
{
this
.
drawingObjects
=
drawingObjects
;
...
...
@@ -698,6 +706,8 @@ function DrawingObjectsController(drawingObjects)
this
.
chartForProps
=
null
;
this
.
lastOverObject
=
null
;
this
.
handleEventMode
=
HANDLE_EVENT_MODE_HANDLE
;
}
...
...
@@ -1562,6 +1572,14 @@ DrawingObjectsController.prototype =
{
drawingDocument
.
DrawTrackSelectShapes
(
this
.
selectionRect
.
x
,
this
.
selectionRect
.
y
,
this
.
selectionRect
.
w
,
this
.
selectionRect
.
h
);
}
if
(
this
.
connector
){
this
.
connector
.
drawConnectors
(
drawingDocument
.
AutoShapesTrack
);
this
.
connector
=
null
;
}
if
(
undefined
!==
drawingDocument
.
EndDrawTracking
)
drawingDocument
.
EndDrawTracking
();
...
...
@@ -10778,4 +10796,5 @@ function ApplyPresetToChartSpace(oChartSpace, aPreset, bCreate){
window
[
'
AscFormat
'
].
CollectDLbls
=
CollectDLbls
;
window
[
'
AscFormat
'
].
CollectSettingsSpPr
=
CollectSettingsSpPr
;
window
[
'
AscFormat
'
].
CheckLinePresetForParagraphAdd
=
CheckLinePresetForParagraphAdd
;
window
[
'
AscFormat
'
].
isConnectorPreset
=
isConnectorPreset
;
})(
window
);
common/Drawings/Format/CnxShape.js
View file @
59eaaa54
...
...
@@ -261,7 +261,7 @@
posX
=
(
_end
.
x
+
_begin
.
x
)
/
2.0
-
extX
/
2.0
;
posY
=
(
_end
.
y
+
_begin
.
y
)
/
2.0
-
extY
/
2.0
;
flipH
=
true
;
oMapAdj
[
"
adj1
"
]
=
(
-
100000
*
(
CONNECTOR_MARGIN
/
extX
)
+
0.5
)
>>
0
;
oMapAdj
[
"
adj1
"
]
=
(
-
100000
*
(
(
_end
.
bounds
.
b
+
CONNECTOR_MARGIN
-
_end
.
y
)
/
extX
)
+
0.5
)
>>
0
;
oMapAdj
[
"
adj2
"
]
=
100000
-
(
100000
*
(((
_begin
.
bounds
.
r
+
_end
.
bounds
.
l
)
/
2
-
(
xc
-
extY
/
2
))
/
extY
)
+
0.5
)
>>
0
;
}
}
...
...
common/Drawings/States.js
View file @
59eaaa54
...
...
@@ -55,6 +55,8 @@ function StartAddNewShape(drawingObjects, preset)
this
.
startX
=
null
;
this
.
startY
=
null
;
this
.
oldConnector
=
null
;
}
StartAddNewShape
.
prototype
=
...
...
@@ -91,6 +93,30 @@ StartAddNewShape.prototype =
this
.
drawingObjects
.
arrTrackObjects
[
0
].
track
(
e
,
x
,
y
);
this
.
drawingObjects
.
updateOverlay
();
}
else
{
if
(
AscFormat
.
isConnectorPreset
(
this
.
preset
)){
var
oOldState
=
this
.
drawingObjects
.
curState
;
this
.
drawingObjects
.
connector
=
null
;
this
.
drawingObjects
.
changeCurrentState
(
new
AscFormat
.
NullState
(
this
.
drawingObjects
));
var
oResult
;
this
.
drawingObjects
.
handleEventMode
=
HANDLE_EVENT_MODE_CURSOR
;
oResult
=
this
.
drawingObjects
.
curState
.
onMouseDown
(
e
,
x
,
y
,
0
);
this
.
drawingObjects
.
handleEventMode
=
HANDLE_EVENT_MODE_HANDLE
;
this
.
drawingObjects
.
changeCurrentState
(
oOldState
);
if
(
oResult
){
var
oObject
=
AscCommon
.
g_oTableId
.
Get_ById
(
oResult
.
objectId
);
if
(
oObject
.
getObjectType
()
===
AscDFH
.
historyitem_type_Shape
){
this
.
drawingObjects
.
connector
=
oObject
;
}
}
if
(
this
.
drawingObjects
.
connector
!==
this
.
oldConnector
){
this
.
drawingObjects
.
updateOverlay
();
}
this
.
oldConnector
=
this
.
drawingObjects
.
connector
;
}
}
},
onMouseUp
:
function
(
e
,
x
,
y
)
...
...
common/Drawings/TrackObjects/NewShapeTracks.js
View file @
59eaaa54
...
...
@@ -138,7 +138,7 @@ function NewShapeTrack(presetGeom, startX, startY, theme, master, layout, slide,
AscFormat
.
ExecuteNoHistory
(
function
(){
if
(
slide
){
this
.
bConnector
=
presetGeom
.
toLowerCase
().
indexOf
(
"
connector
"
)
>
-
1
;
this
.
bConnector
=
AscFormat
.
isConnectorPreset
(
presetGeom
)
;
if
(
this
.
bConnector
){
var
aSpTree
=
slide
.
cSld
.
spTree
;
var
oConnector
=
null
;
...
...
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