深度画布调整属性设置
This commit is contained in:
@@ -61,13 +61,26 @@ export function getStarArr(width = 0, height = 0) {
|
||||
}))
|
||||
}
|
||||
/** 获取箭头路径 */
|
||||
export function getArrowPath(width = 0, height = 0) {
|
||||
export function getArrowPath(width = 0, strokeWidth = 4) {
|
||||
const height = strokeWidth * 4
|
||||
const arr = [
|
||||
["M", 0, height / 2],
|
||||
["L", width, height / 2],
|
||||
["M", width - 8, 0],
|
||||
["M", width - height, 0],
|
||||
["L", width, height / 2],
|
||||
["L", width - height, height],
|
||||
]
|
||||
var path = ""
|
||||
arr.forEach(item => {
|
||||
path += item.join(" ") + " "
|
||||
})
|
||||
return path
|
||||
}
|
||||
/** 获取直线路径 */
|
||||
export function getLinePath(width = 0, height = 0) {
|
||||
const arr = [
|
||||
["M", 0, height / 2],
|
||||
["L", width, height / 2],
|
||||
["L", width - 8, height],
|
||||
]
|
||||
var path = ""
|
||||
arr.forEach(item => {
|
||||
|
||||
Reference in New Issue
Block a user