@bwp-web/canvas 0.14.0 → 0.15.0
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/dist/index.cjs +10 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +10 -8
- package/dist/index.js.map +1 -1
- package/dist/interactions/drawToCreate.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1920,10 +1920,11 @@ function enableDrawToCreate(canvas, options) {
|
|
|
1920
1920
|
const finalize = () => {
|
|
1921
1921
|
removePreviewElements();
|
|
1922
1922
|
snapping.clearSnapResult();
|
|
1923
|
-
const
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
}
|
|
1923
|
+
const styleWithData = {
|
|
1924
|
+
...options?.style,
|
|
1925
|
+
...options?.data != null && { data: options.data }
|
|
1926
|
+
};
|
|
1927
|
+
const obj = options?.factory ? options.factory(canvas, [...points]) : createPolygonFromVertices(canvas, points, styleWithData);
|
|
1927
1928
|
canvas.selection = previousSelection;
|
|
1928
1929
|
canvas.requestRenderAll();
|
|
1929
1930
|
restoreViewport(options?.viewport);
|
|
@@ -2083,6 +2084,10 @@ function enableDrawToCreate(canvas, options) {
|
|
|
2083
2084
|
placeVertex(dragStartX, dragStartY);
|
|
2084
2085
|
return;
|
|
2085
2086
|
}
|
|
2087
|
+
const dragStyleWithData = {
|
|
2088
|
+
...options?.style,
|
|
2089
|
+
...options?.data != null && { data: options.data }
|
|
2090
|
+
};
|
|
2086
2091
|
const obj = createPolygonFromVertices(
|
|
2087
2092
|
canvas,
|
|
2088
2093
|
[
|
|
@@ -2091,11 +2096,8 @@ function enableDrawToCreate(canvas, options) {
|
|
|
2091
2096
|
{ x: dragStartX + width, y: dragStartY + height },
|
|
2092
2097
|
{ x: dragStartX, y: dragStartY + height }
|
|
2093
2098
|
],
|
|
2094
|
-
|
|
2099
|
+
dragStyleWithData
|
|
2095
2100
|
);
|
|
2096
|
-
if (options?.data) {
|
|
2097
|
-
obj.data = options.data;
|
|
2098
|
-
}
|
|
2099
2101
|
canvas.selection = previousSelection;
|
|
2100
2102
|
canvas.requestRenderAll();
|
|
2101
2103
|
restoreViewport(options?.viewport);
|