@8btc/whiteboard 0.0.16 → 0.0.17
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.d.ts +1 -1
- package/dist/index.js +5 -1
- package/dist/index.umd.js +5 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -58,7 +58,7 @@ export declare class CanvasApi extends CanvasCore {
|
|
|
58
58
|
/**
|
|
59
59
|
* 导出带有标注的图片节点为图片
|
|
60
60
|
* @param id - 图片节点 ID
|
|
61
|
-
* @returns DataURL
|
|
61
|
+
* @returns DataURL 格式的图片数据,如果节点或者 marker 不存在则返回 null
|
|
62
62
|
*/
|
|
63
63
|
exportImageWithMarker(id: string, options?: {
|
|
64
64
|
pixelRatio?: number;
|
package/dist/index.js
CHANGED
|
@@ -1804,7 +1804,7 @@ class CanvasApi extends CanvasCore {
|
|
|
1804
1804
|
/**
|
|
1805
1805
|
* 导出带有标注的图片节点为图片
|
|
1806
1806
|
* @param id - 图片节点 ID
|
|
1807
|
-
* @returns DataURL
|
|
1807
|
+
* @returns DataURL 格式的图片数据,如果节点或者 marker 不存在则返回 null
|
|
1808
1808
|
*/
|
|
1809
1809
|
exportImageWithMarker(id, options) {
|
|
1810
1810
|
const imageShape = this.getStage().findOne(`#${id}`);
|
|
@@ -1816,6 +1816,10 @@ class CanvasApi extends CanvasCore {
|
|
|
1816
1816
|
const markerNodes = nodes.filter(
|
|
1817
1817
|
(n) => n.type === "image-marker" && n.meta.parent === id
|
|
1818
1818
|
);
|
|
1819
|
+
if (markerNodes.length === 0) {
|
|
1820
|
+
console.warn("No image-marker nodes found for the given image ID");
|
|
1821
|
+
return null;
|
|
1822
|
+
}
|
|
1819
1823
|
const tempGroup = new Konva.Group();
|
|
1820
1824
|
const imageClone = imageShape.clone();
|
|
1821
1825
|
tempGroup.add(imageClone);
|
package/dist/index.umd.js
CHANGED
|
@@ -3121,7 +3121,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
3121
3121
|
/**
|
|
3122
3122
|
* 导出带有标注的图片节点为图片
|
|
3123
3123
|
* @param id - 图片节点 ID
|
|
3124
|
-
* @returns DataURL
|
|
3124
|
+
* @returns DataURL 格式的图片数据,如果节点或者 marker 不存在则返回 null
|
|
3125
3125
|
*/
|
|
3126
3126
|
exportImageWithMarker(id, options) {
|
|
3127
3127
|
const imageShape = this.getStage().findOne(`#${id}`);
|
|
@@ -3133,6 +3133,10 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
|
|
|
3133
3133
|
const markerNodes = nodes.filter(
|
|
3134
3134
|
(n) => n.type === "image-marker" && n.meta.parent === id
|
|
3135
3135
|
);
|
|
3136
|
+
if (markerNodes.length === 0) {
|
|
3137
|
+
console.warn("No image-marker nodes found for the given image ID");
|
|
3138
|
+
return null;
|
|
3139
|
+
}
|
|
3136
3140
|
const tempGroup = new Konva.Group();
|
|
3137
3141
|
const imageClone = imageShape.clone();
|
|
3138
3142
|
tempGroup.add(imageClone);
|