next-element-vue 0.6.2 → 0.6.3

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.
@@ -0,0 +1,31 @@
1
+ import type { ShapesProps } from '../config';
2
+ export default class EditRectangle {
3
+ canvas: HTMLCanvasElement;
4
+ ctx: CanvasRenderingContext2D;
5
+ shape: ShapesProps;
6
+ private anchorRadius;
7
+ private anchorVertexIndex;
8
+ private isMoveEditing;
9
+ private mouseMoveOffset;
10
+ private isEditing;
11
+ private vertexes;
12
+ private editingObservers;
13
+ private editedObserver?;
14
+ constructor(canvas: HTMLCanvasElement, ctx: CanvasRenderingContext2D);
15
+ onEditing(observer: (vertexes: [number, number][]) => void): void;
16
+ offEditing(observer: (vertexes: [number, number][]) => void): void;
17
+ private notifyEditing;
18
+ onEditCompleted(callback: (vertexes: [number, number][]) => void): void;
19
+ private notifyEditCompleted;
20
+ private getTransformPoint;
21
+ drawRectangle(vertexes: [number, number][]): void;
22
+ private drawVertexAnchors;
23
+ private pointInVertexAnchors;
24
+ private updateCanvasCursor;
25
+ private canvasMouseDown;
26
+ private canvasMouseMove;
27
+ private canvasMouseUp;
28
+ private canvasMouseClick;
29
+ render(): void;
30
+ destroy(): void;
31
+ }
@@ -14,6 +14,15 @@ export declare const printsToPath: (vertexes: [number, number][]) => Path2D;
14
14
  * @returns
15
15
  */
16
16
  export declare const isPointInPath: (px: number, py: number, vertexes: [number, number][], ctx: CanvasRenderingContext2D) => boolean;
17
+ /**
18
+ * 点是否在矩形内
19
+ * @param px 鼠标x坐标
20
+ * @param py 鼠标y坐标
21
+ * @param vertexes 点位数据
22
+ * @param ctx 上下文
23
+ * @returns
24
+ */
25
+ export declare const isPointInRectangle: (px: number, py: number, vertexes: [number, number][], ctx: CanvasRenderingContext2D) => boolean;
17
26
  /**
18
27
  * 点是否在折线内
19
28
  * @param px 鼠标x坐标
@@ -24,6 +24,7 @@ export declare class CreateDrawCanvas {
24
24
  private createPolygon;
25
25
  private editDrawPolygon;
26
26
  private createRectangle;
27
+ private editDrawRectangle;
27
28
  private addVertexes;
28
29
  private createCompleteSubscribers;
29
30
  private editingShape;
@@ -54,6 +55,7 @@ export declare class CreateDrawCanvas {
54
55
  render: () => void;
55
56
  private mouseHitShape;
56
57
  triggerShapeEdit(shape: ShapesProps): void;
58
+ private onResetHitShape;
57
59
  private onMouseDoubleClick;
58
60
  private onMouseClick;
59
61
  private onMouseDown;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-element-vue",
3
- "version": "0.6.2",
3
+ "version": "0.6.3",
4
4
  "author": {
5
5
  "name": "huangteng",
6
6
  "email": "htengweb@163.com"