深度画布调整属性设置

This commit is contained in:
lzp
2026-03-26 10:53:01 +08:00
parent e03bb2486c
commit 164ac3789f
10 changed files with 259 additions and 177 deletions

View File

@@ -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 => {