mirror of
https://github.com/wanglin2/mind-map.git
synced 2026-02-17 14:04:47 +08:00
Feat:主题支持配置背景渐变的方向
This commit is contained in:
@@ -124,6 +124,8 @@ class Style {
|
||||
gradientStyle: this.merge('gradientStyle'),
|
||||
startColor: this.merge('startColor'),
|
||||
endColor: this.merge('endColor'),
|
||||
startDir: this.merge('startDir'),
|
||||
endDir: this.merge('endDir'),
|
||||
fillColor: this.merge('fillColor'),
|
||||
borderColor: this.merge('borderColor'),
|
||||
borderWidth: this.merge('borderWidth'),
|
||||
@@ -137,6 +139,7 @@ class Style {
|
||||
add.stop(0, styles.startColor)
|
||||
add.stop(1, styles.endColor)
|
||||
})
|
||||
this._gradient.from(...styles.startDir).to(...styles.endDir)
|
||||
node.fill(this._gradient)
|
||||
} else {
|
||||
node.fill({
|
||||
|
||||
@@ -82,6 +82,8 @@ export default {
|
||||
gradientStyle: false,
|
||||
startColor: '#549688',
|
||||
endColor: '#fff',
|
||||
startDir: [0, 0],
|
||||
endDir: [1, 0],
|
||||
// 连线标记的位置,start(头部)、end(尾部),该配置在showLineMarker配置为true时生效
|
||||
lineMarkerDir: 'end'
|
||||
},
|
||||
@@ -105,6 +107,8 @@ export default {
|
||||
gradientStyle: false,
|
||||
startColor: '#549688',
|
||||
endColor: '#fff',
|
||||
startDir: [0, 0],
|
||||
endDir: [1, 0],
|
||||
lineMarkerDir: 'end'
|
||||
},
|
||||
// 三级及以下节点样式
|
||||
@@ -127,6 +131,8 @@ export default {
|
||||
gradientStyle: false,
|
||||
startColor: '#549688',
|
||||
endColor: '#fff',
|
||||
startDir: [0, 0],
|
||||
endDir: [1, 0],
|
||||
lineMarkerDir: 'end'
|
||||
},
|
||||
// 概要节点样式
|
||||
@@ -148,7 +154,9 @@ export default {
|
||||
textDecoration: 'none',
|
||||
gradientStyle: false,
|
||||
startColor: '#549688',
|
||||
endColor: '#fff'
|
||||
endColor: '#fff',
|
||||
startDir: [0, 0],
|
||||
endDir: [1, 0]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -179,7 +187,9 @@ const nodeSizeIndependenceList = [
|
||||
'gradientStyle',
|
||||
'lineRadius',
|
||||
'startColor',
|
||||
'endColor'
|
||||
'endColor',
|
||||
'startDir',
|
||||
'endDir'
|
||||
]
|
||||
export const checkIsNodeSizeIndependenceConfig = config => {
|
||||
let keys = Object.keys(config)
|
||||
|
||||
Reference in New Issue
Block a user