mirror of
https://github.com/wanglin2/mind-map.git
synced 2026-02-28 13:57:48 +08:00
Feat:节点矩形形状改为使用path渲染
This commit is contained in:
parent
a24f7a73c8
commit
1b0646af6d
@ -104,11 +104,18 @@ export default class Shape {
|
||||
let { width, height } = this.node
|
||||
let borderRadius = this.node.style.merge('borderRadius')
|
||||
return new Path().plot(`
|
||||
M${0},0
|
||||
L${width},0
|
||||
L${width},${height}
|
||||
L${0},${height}
|
||||
L${0},${0}
|
||||
M${borderRadius},0
|
||||
L${width - borderRadius},0
|
||||
C${width - borderRadius},0 ${width},${0} ${width},${borderRadius}
|
||||
L${width},${height - borderRadius}
|
||||
C${width},${height - borderRadius} ${width},${height} ${
|
||||
width - borderRadius
|
||||
},${height}
|
||||
L${borderRadius},${height}
|
||||
C${borderRadius},${height} ${0},${height} ${0},${height - borderRadius}
|
||||
L${0},${borderRadius}
|
||||
C${0},${borderRadius} ${0},${0} ${borderRadius},${0}
|
||||
Z
|
||||
`)
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user