From ae5d3b87117874ea383ce667cbed1a23cb10ff62 Mon Sep 17 00:00:00 2001 From: TaTo30 Date: Mon, 6 May 2024 21:55:19 -0600 Subject: [PATCH] Add events reference to README --- README.md | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) diff --git a/README.md b/README.md index 260b4bc..c1c5ea2 100644 --- a/README.md +++ b/README.md @@ -166,3 +166,69 @@ Default (All properties are optional): }" /> ``` + +## Events + +### loaded + +Emitted once the image has been loaded. + +```vue + +``` + +### moving + +Emitted when a point has been moved. + +```vue + +``` + +The payload value contains the coordinates of all points in the canvas and scaled to image's dimensions + +Example: + +```json +{ + // Coordinates based on canvas + "canvas": [ + { + x: 120, + y: 52 + }, + { + x: 620, + y: 80 + }, + { + x: 690, + y: 240 + }, + { + x: 90, + y: 300 + } + ], + // Coordinates scaled in base image's dimensions (scale: 2, in this example) + "image": { + { + x: 240, + y: 104 + }, + { + x: 1240, + y: 160 + }, + { + x: 1380, + y: 480 + }, + { + x: 180, + y: 600 + } + } +} + +``` \ No newline at end of file