leafer-ui icon indicating copy to clipboard operation
leafer-ui copied to clipboard

子 stroke 的 style 设置 strokeAlign 无效

Open Xdy1579883916 opened this issue 3 months ago • 4 comments

子 stroke 的 style 设置 strokeAlign 无效,我看ts类型中定义了,但是文档确实没有说支持,是还没有支持吗?

import { Leafer, Text } from 'leafer-ui'

const leafer = new Leafer({ view: window })

const rect = new Text({
    fill: "#f40",
    text: "leafer",
    fontSize: 100,
    "strokeAlign": "outside",
    x: 100,
    stroke: [
        {
            "type": "solid",
            "color": "#ffffff",
            "style": {
            "strokeWidth": 12,
            "strokeJoin": "round",
            "strokeAlign": "inside",
            "strokeCap": "round"
            },
            "visible": true
        },
        {
            "type": "solid",
            "color": "#000",
            "visible": true,
            "style": {
            "strokeWidth": 5,
            "strokeJoin": "round",
            "strokeAlign": "center"
            }
        }
    ]
})

leafer.add(rect)

Xdy1579883916 avatar Sep 22 '25 08:09 Xdy1579883916

是的,目前还不支持,可以通过设置strokeWidth来模拟

leaferjs avatar Sep 22 '25 09:09 leaferjs

是不是有什么困难,可以支持吗?

Xdy1579883916 avatar Sep 22 '25 09:09 Xdy1579883916

会增加几何倍的代码复杂度,后续维护也会更麻烦。

后续想到好的方案再支持。

leaferjs avatar Sep 22 '25 23:09 leaferjs

好的,感谢解答

Xdy1579883916 avatar Sep 23 '25 00:09 Xdy1579883916