@leafer-ui/paint 1.0.10 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +5 -5
- package/src/Stroke.ts +15 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leafer-ui/paint",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "@leafer-ui/paint",
|
|
5
5
|
"author": "Chao (Leafer) Wan",
|
|
6
6
|
"license": "MIT",
|
|
@@ -22,11 +22,11 @@
|
|
|
22
22
|
"leaferjs"
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@leafer/core": "1.
|
|
26
|
-
"@leafer-ui/draw": "1.
|
|
25
|
+
"@leafer/core": "1.1.1",
|
|
26
|
+
"@leafer-ui/draw": "1.1.1"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@leafer/interface": "1.
|
|
30
|
-
"@leafer-ui/interface": "1.
|
|
29
|
+
"@leafer/interface": "1.1.1",
|
|
30
|
+
"@leafer-ui/interface": "1.1.1"
|
|
31
31
|
}
|
|
32
32
|
}
|
package/src/Stroke.ts
CHANGED
|
@@ -22,6 +22,9 @@ export function stroke(stroke: string, ui: IUI, canvas: ILeaferCanvas): void {
|
|
|
22
22
|
|
|
23
23
|
canvas.setStroke(stroke, __strokeWidth, options)
|
|
24
24
|
canvas.stroke()
|
|
25
|
+
|
|
26
|
+
if (options.__useArrow) strokeArrow(ui, canvas)
|
|
27
|
+
|
|
25
28
|
break
|
|
26
29
|
|
|
27
30
|
case 'inside':
|
|
@@ -74,6 +77,8 @@ export function strokes(strokes: ILeafPaint[], ui: IUI, canvas: ILeaferCanvas):
|
|
|
74
77
|
case 'center':
|
|
75
78
|
canvas.setStroke(undefined, __strokeWidth, options)
|
|
76
79
|
drawStrokesStyle(strokes, false, ui, canvas)
|
|
80
|
+
|
|
81
|
+
if (options.__useArrow) strokeArrow(ui, canvas)
|
|
77
82
|
break
|
|
78
83
|
|
|
79
84
|
case 'inside':
|
|
@@ -108,3 +113,13 @@ export function strokes(strokes: ILeafPaint[], ui: IUI, canvas: ILeaferCanvas):
|
|
|
108
113
|
}
|
|
109
114
|
|
|
110
115
|
}
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
function strokeArrow(ui: IUI, canvas: ILeaferCanvas): void {
|
|
119
|
+
if (ui.__.dashPattern) { // fix: dashPattern Arrow
|
|
120
|
+
canvas.beginPath()
|
|
121
|
+
ui.__drawPathByData(canvas, ui.__.__pathForArrow)
|
|
122
|
+
canvas.dashPattern = null
|
|
123
|
+
canvas.stroke()
|
|
124
|
+
}
|
|
125
|
+
}
|