cnhis-design-vue 3.4.0-beta.44 → 3.4.0-beta.45
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.
|
@@ -134,6 +134,33 @@ function useCenter(canvas, propItems, emits, computedX, computedY, getXValue, ge
|
|
|
134
134
|
const line = drawLine([originX, y, endX, y], scaleValue.positionLine);
|
|
135
135
|
canvas.value.add(line);
|
|
136
136
|
}
|
|
137
|
+
function creatShaDowBorder(points, mode, style) {
|
|
138
|
+
const borderGroup = new fabric.Group();
|
|
139
|
+
const lines = [];
|
|
140
|
+
const drawnLines = /* @__PURE__ */ new Set();
|
|
141
|
+
for (let i = 0; i < points.length; i++) {
|
|
142
|
+
const nextIndex = (i + 1) % points.length;
|
|
143
|
+
const startPoint = points[i];
|
|
144
|
+
const endPoint = points[nextIndex];
|
|
145
|
+
const lineKey1 = `${startPoint.x},${startPoint.y},${endPoint.x},${endPoint.y}`;
|
|
146
|
+
const lineKey2 = `${endPoint.x},${endPoint.y},${startPoint.x},${startPoint.y}`;
|
|
147
|
+
if (drawnLines.has(lineKey1) || drawnLines.has(lineKey2)) {
|
|
148
|
+
continue;
|
|
149
|
+
}
|
|
150
|
+
if (startPoint.x === endPoint.x && startPoint.y === endPoint.y || mode === "line" && startPoint.x === endPoint.x) {
|
|
151
|
+
continue;
|
|
152
|
+
}
|
|
153
|
+
drawnLines.add(lineKey1);
|
|
154
|
+
const line = new fabric.Line([startPoint.x, startPoint.y, endPoint.x, endPoint.y], {
|
|
155
|
+
...defaultStyle,
|
|
156
|
+
...style,
|
|
157
|
+
strokeWidth: 1
|
|
158
|
+
});
|
|
159
|
+
lines.push(line);
|
|
160
|
+
}
|
|
161
|
+
borderGroup.add(...lines).addWithUpdate();
|
|
162
|
+
return borderGroup;
|
|
163
|
+
}
|
|
137
164
|
function drawShaDow(target) {
|
|
138
165
|
var _a;
|
|
139
166
|
const pulseObj = yScaleValue.find((item) => item.show && item.type === "pulse");
|
|
@@ -174,16 +201,12 @@ function useCenter(canvas, propItems, emits, computedX, computedY, getXValue, ge
|
|
|
174
201
|
x: v[0],
|
|
175
202
|
y: v[1]
|
|
176
203
|
}));
|
|
177
|
-
const polygon = new fabric.Polygon(points, {
|
|
204
|
+
const polygon = mode === "color" ? new fabric.Polygon(points, {
|
|
178
205
|
...defaultStyle,
|
|
179
206
|
...style,
|
|
180
207
|
strokeWidth: 1
|
|
181
|
-
});
|
|
208
|
+
}) : creatShaDowBorder(points, mode, style);
|
|
182
209
|
if (["slash", "line"].includes(mode)) {
|
|
183
|
-
polygon.set({
|
|
184
|
-
fill: "transparent",
|
|
185
|
-
stroke: style.stroke || "#f00"
|
|
186
|
-
});
|
|
187
210
|
const shadowLines = [];
|
|
188
211
|
if (["slash"].includes(mode)) {
|
|
189
212
|
shadowLines.push(...createShadowLines(item, style._angle, style.space, omit(style, ["_angle", "space"])));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cnhis-design-vue",
|
|
3
|
-
"version": "3.4.0-beta.
|
|
3
|
+
"version": "3.4.0-beta.45",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"module": "./es/components/index.js",
|
|
6
6
|
"main": "./es/components/index.js",
|
|
@@ -73,5 +73,5 @@
|
|
|
73
73
|
"iOS 7",
|
|
74
74
|
"last 3 iOS versions"
|
|
75
75
|
],
|
|
76
|
-
"gitHead": "
|
|
76
|
+
"gitHead": "d3ced341f7fb5a1e994e5a2b243c90491941f4b4"
|
|
77
77
|
}
|