mirror of
https://github.com/wanglin2/mind-map.git
synced 2026-02-21 18:37:43 +08:00
Feat:新增节点连线样式是否允许继承祖先的样式的实例化选项
This commit is contained in:
parent
8c7d11c629
commit
86c84cba0b
@ -321,6 +321,8 @@ export const defaultOpt = {
|
||||
}
|
||||
*/
|
||||
addCustomContentToNode: null,
|
||||
// 节点连线样式是否允许继承祖先的连线样式
|
||||
enableInheritAncestorLineStyle: false,
|
||||
|
||||
// 【Select插件】
|
||||
// 多选节点时鼠标移动到边缘时的画布移动偏移量
|
||||
|
||||
@ -296,7 +296,10 @@ class MindMapNode {
|
||||
typeof addCustomContentToNode.create === 'function'
|
||||
) {
|
||||
this._customContentAddToNodeAdd = addCustomContentToNode.create(this)
|
||||
if (this._customContentAddToNodeAdd && this._customContentAddToNodeAdd.el) {
|
||||
if (
|
||||
this._customContentAddToNodeAdd &&
|
||||
this._customContentAddToNodeAdd.el
|
||||
) {
|
||||
addXmlns(this._customContentAddToNodeAdd.el)
|
||||
}
|
||||
}
|
||||
@ -883,15 +886,18 @@ class MindMapNode {
|
||||
|
||||
// 设置连线样式
|
||||
styleLine(line, childNode, enableMarker) {
|
||||
const { enableInheritAncestorLineStyle } = this.mindMap.opt
|
||||
const getName = enableInheritAncestorLineStyle
|
||||
? 'getSelfInhertStyle'
|
||||
: 'getSelfStyle'
|
||||
const width =
|
||||
childNode.getSelfInhertStyle('lineWidth') ||
|
||||
childNode.getStyle('lineWidth', true)
|
||||
childNode[getName]('lineWidth') || childNode.getStyle('lineWidth', true)
|
||||
const color =
|
||||
childNode.getSelfInhertStyle('lineColor') ||
|
||||
childNode[getName]('lineColor') ||
|
||||
this.getRainbowLineColor(childNode) ||
|
||||
childNode.getStyle('lineColor', true)
|
||||
const dasharray =
|
||||
childNode.getSelfInhertStyle('lineDasharray') ||
|
||||
childNode[getName]('lineDasharray') ||
|
||||
childNode.getStyle('lineDasharray', true)
|
||||
this.style.line(
|
||||
line,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user