@8btc/whiteboard 0.0.6 → 0.0.7
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.js +8 -9
- package/dist/index.umd.js +8 -9
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -81,7 +81,6 @@ class CanvasStage {
|
|
|
81
81
|
}
|
|
82
82
|
if (toolType === "image-marker" && pointerPos) {
|
|
83
83
|
const imageShape = __privateGet(this, _core).findImageAtPosition(pointerPos);
|
|
84
|
-
console.log(imageShape, "imageShape");
|
|
85
84
|
if (imageShape) {
|
|
86
85
|
const width = imageShape.width();
|
|
87
86
|
const height = imageShape.height();
|
|
@@ -1448,21 +1447,21 @@ class CanvasCore extends CanvasState {
|
|
|
1448
1447
|
* @internal 仅供内部使用
|
|
1449
1448
|
*/
|
|
1450
1449
|
findImageAtPosition(position) {
|
|
1451
|
-
const
|
|
1452
|
-
const imageShapes =
|
|
1450
|
+
const layer = __privateGet(this, _mainLayer).getLayer();
|
|
1451
|
+
const imageShapes = layer.find(
|
|
1453
1452
|
(node) => node.getClassName() === "Image"
|
|
1454
1453
|
);
|
|
1455
1454
|
const originalListeningStates = imageShapes.map(
|
|
1456
1455
|
(shape) => shape.listening()
|
|
1457
1456
|
);
|
|
1458
1457
|
imageShapes.forEach((shape) => shape.listening(true));
|
|
1458
|
+
layer.draw();
|
|
1459
1459
|
try {
|
|
1460
|
-
const
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
return imageShapesAtPos[imageShapesAtPos.length - 1];
|
|
1460
|
+
const shape = layer.getIntersection(position);
|
|
1461
|
+
if (shape?.getClassName() === "Image") {
|
|
1462
|
+
return shape;
|
|
1463
|
+
}
|
|
1464
|
+
return null;
|
|
1466
1465
|
} finally {
|
|
1467
1466
|
imageShapes.forEach((shape, index) => {
|
|
1468
1467
|
shape.listening(originalListeningStates[index]);
|
package/dist/index.umd.js
CHANGED
|
@@ -1400,7 +1400,6 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
1400
1400
|
}
|
|
1401
1401
|
if (toolType === "image-marker" && pointerPos) {
|
|
1402
1402
|
const imageShape = __privateGet(this, _core).findImageAtPosition(pointerPos);
|
|
1403
|
-
console.log(imageShape, "imageShape");
|
|
1404
1403
|
if (imageShape) {
|
|
1405
1404
|
const width = imageShape.width();
|
|
1406
1405
|
const height = imageShape.height();
|
|
@@ -2767,21 +2766,21 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
2767
2766
|
* @internal 仅供内部使用
|
|
2768
2767
|
*/
|
|
2769
2768
|
findImageAtPosition(position) {
|
|
2770
|
-
const
|
|
2771
|
-
const imageShapes =
|
|
2769
|
+
const layer = __privateGet(this, _mainLayer).getLayer();
|
|
2770
|
+
const imageShapes = layer.find(
|
|
2772
2771
|
(node) => node.getClassName() === "Image"
|
|
2773
2772
|
);
|
|
2774
2773
|
const originalListeningStates = imageShapes.map(
|
|
2775
2774
|
(shape) => shape.listening()
|
|
2776
2775
|
);
|
|
2777
2776
|
imageShapes.forEach((shape) => shape.listening(true));
|
|
2777
|
+
layer.draw();
|
|
2778
2778
|
try {
|
|
2779
|
-
const
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
return imageShapesAtPos[imageShapesAtPos.length - 1];
|
|
2779
|
+
const shape = layer.getIntersection(position);
|
|
2780
|
+
if (shape?.getClassName() === "Image") {
|
|
2781
|
+
return shape;
|
|
2782
|
+
}
|
|
2783
|
+
return null;
|
|
2785
2784
|
} finally {
|
|
2786
2785
|
imageShapes.forEach((shape, index) => {
|
|
2787
2786
|
shape.listening(originalListeningStates[index]);
|