@bwp-web/canvas 0.9.2 → 0.9.4
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/hooks/useEditCanvas.d.ts +1 -1
- package/dist/hooks/useEditCanvas.d.ts.map +1 -1
- package/dist/index.cjs +156 -17
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +166 -26
- package/dist/index.js.map +1 -1
- package/dist/interactions/drawToCreate.d.ts +14 -0
- package/dist/interactions/drawToCreate.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -25,6 +25,15 @@ export interface DrawToCreateOptions extends SnappableInteractionOptions {
|
|
|
25
25
|
angleSnap?: boolean | {
|
|
26
26
|
interval?: number;
|
|
27
27
|
};
|
|
28
|
+
/**
|
|
29
|
+
* When enabled, pressing and dragging (instead of clicking) on the first
|
|
30
|
+
* interaction creates a rectangular polygon from the drag bounds — exactly
|
|
31
|
+
* like {@link enableDragToCreate} behaves for polygons. Shift constrains
|
|
32
|
+
* to a square. Once a vertex has been placed, normal draw behaviour applies.
|
|
33
|
+
*
|
|
34
|
+
* Pass `false` to disable. Default: enabled.
|
|
35
|
+
*/
|
|
36
|
+
dragOnHold?: boolean;
|
|
28
37
|
/** Called when the user cancels drawing via Escape or Backspace. */
|
|
29
38
|
onCancel?: () => void;
|
|
30
39
|
}
|
|
@@ -33,6 +42,11 @@ export interface DrawToCreateOptions extends SnappableInteractionOptions {
|
|
|
33
42
|
* Click to place vertices one by one. A preview shows edges and a tracking line
|
|
34
43
|
* to the cursor. Click near the first vertex (within threshold) to close the
|
|
35
44
|
* polygon once at least 3 points have been placed.
|
|
45
|
+
*
|
|
46
|
+
* When `dragOnHold` is enabled (default), pressing and dragging on the first
|
|
47
|
+
* interaction creates a rectangular polygon from the drag bounds instead of
|
|
48
|
+
* placing individual vertices.
|
|
49
|
+
*
|
|
36
50
|
* Returns a cleanup function that disables the mode.
|
|
37
51
|
*/
|
|
38
52
|
export declare function enableDrawToCreate(canvas: FabricCanvas, options?: DrawToCreateOptions): () => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drawToCreate.d.ts","sourceRoot":"","sources":["../../src/interactions/drawToCreate.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,IAAI,YAAY,EAEtB,YAAY,
|
|
1
|
+
{"version":3,"file":"drawToCreate.d.ts","sourceRoot":"","sources":["../../src/interactions/drawToCreate.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,MAAM,IAAI,YAAY,EAEtB,YAAY,EAIb,MAAM,QAAQ,CAAC;AAChB,OAAO,KAAK,EACV,OAAO,EACP,iBAAiB,EACjB,2BAA2B,EAC5B,MAAM,UAAU,CAAC;AAelB,MAAM,WAAW,mBAAoB,SAAQ,2BAA2B;IACtE,gDAAgD;IAChD,KAAK,CAAC,EAAE,iBAAiB,CAAC;IAC1B;;;;OAIG;IACH,IAAI,CAAC,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC;IAC5B;;;;OAIG;IACH,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,YAAY,CAAC;IACpE;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,OAAO,GAAG;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC5C;;;;;;;OAOG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,oEAAoE;IACpE,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CACvB;AA8ED;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,YAAY,EACpB,OAAO,CAAC,EAAE,mBAAmB,GAC5B,MAAM,IAAI,CAgZZ"}
|