Skip to content

Commit 8edc687

Browse files
设置锚点高亮颜色
1 parent 8e3e54c commit 8edc687

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

src/views/customToolbar/customToolbar.vue

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,7 @@ const {
230230
mxCell,
231231
mxShape,
232232
mxConstraintHandler,
233+
mxEllipse,
233234
// mxTriangle,
234235
mxConnectionConstraint,
235236
mxPolyline,
@@ -678,7 +679,7 @@ export default {
678679
let groupObj = _.pick(addCell, ['id', 'title', 'parent', 'geometry']);
679680
this.jsonData['cells']['groups'].push(groupObj);
680681
} else {
681-
let nodeObj = _.pick(addCell, ['id', , 'title', 'parent', 'geometry']);
682+
let nodeObj = _.pick(addCell, ['id', 'title', 'parent', 'geometry']);
682683
this.jsonData['cells']['nodes'].push(nodeObj);
683684
this.$message.info('添加了一个节点');
684685
}
@@ -1024,7 +1025,12 @@ export default {
10241025
mxConnectionHandler.prototype.connectImage = new mxImage('icon/dot.gif', 10, 10);
10251026
10261027
// 设定锚点的位置、可编辑状态和图标
1027-
mxConstraintHandler.prototype.pointImage = new mxImage('icon/dot.svg', 10, 10);
1028+
mxConstraintHandler.prototype.pointImage = new mxImage('icon/dot.svg', 10, 10)
1029+
// 设置锚点上的高亮颜色
1030+
mxConstraintHandler.prototype.createHighlightShape = function () {
1031+
return new mxEllipse(null, '#409eff99', '#409eff99', 14)
1032+
}
1033+
10281034
mxShape.prototype.constraints = [
10291035
new mxConnectionConstraint(new mxPoint(0, 0), true),
10301036
new mxConnectionConstraint(new mxPoint(0.25, 0), true),

0 commit comments

Comments
 (0)