File tree 3 files changed +23
-12
lines changed
3 files changed +23
-12
lines changed Original file line number Diff line number Diff line change @@ -268,15 +268,22 @@ pnpm dev
268
268
<sub><b>makeng</b></sub>
269
269
</a>
270
270
</td>
271
+ <td align="center">
272
+ <a href="https://github.com/momo2019">
273
+ <img src="https://avatars.githubusercontent.com/u/26078793?v=4" width="80;" alt="momo2019"/>
274
+ <br />
275
+ <sub><b>momo2019</b></sub>
276
+ </a>
277
+ </td>
278
+ </tr>
279
+ <tr>
271
280
<td align="center">
272
281
<a href="https://github.com/z09176141">
273
282
<img src="https://avatars.githubusercontent.com/u/49260613?v=4" width="80;" alt="z09176141"/>
274
283
<br />
275
284
<sub><b>z09176141</b></sub>
276
285
</a>
277
286
</td>
278
- </tr>
279
- <tr>
280
287
<td align="center">
281
288
<a href="https://github.com/a847244052">
282
289
<img src="https://avatars.githubusercontent.com/u/28621500?v=4" width="80;" alt="a847244052"/>
@@ -312,21 +319,14 @@ pnpm dev
312
319
<sub><b>pengzhijian</b></sub>
313
320
</a>
314
321
</td>
322
+ </tr>
323
+ <tr>
315
324
<td align="center">
316
325
<a href="https://github.com/JiangShuQ">
317
326
<img src="https://avatars.githubusercontent.com/u/95730895?v=4" width="80;" alt="JiangShuQ"/>
318
327
<br />
319
328
<sub><b>JiangShuQ</b></sub>
320
329
</a>
321
- </td>
322
- </tr>
323
- <tr>
324
- <td align="center">
325
- <a href="https://github.com/momo2019">
326
- <img src="https://avatars.githubusercontent.com/u/26078793?v=4" width="80;" alt="momo2019"/>
327
- <br />
328
- <sub><b>momo2019</b></sub>
329
- </a>
330
330
</td>
331
331
<td align="center">
332
332
<a href="https://github.com/hudenghui">
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ type IEditor = Editor;
12
12
13
13
class MaskPlugin implements IPluginTempl {
14
14
static pluginName = 'MaskPlugin' ;
15
- static apis = [ 'setCoverMask' , 'workspaceMaskToggle' ] ;
15
+ static apis = [ 'setCoverMask' , 'workspaceMaskToggle' , 'getworkspaceMaskStatus' ] ;
16
16
coverMask : null | fabric . Rect = null ;
17
17
workspace : null | fabric . Rect = null ;
18
18
workspaceEl ! : HTMLElement ;
@@ -42,11 +42,18 @@ class MaskPlugin implements IPluginTempl {
42
42
workspaceMask && this . canvas . remove ( workspaceMask ) ;
43
43
this . workspace ?. clone ( ( cloned : fabric . Rect ) => {
44
44
this . canvas . clipPath = cloned ;
45
+ this . coverMask = null ;
45
46
this . canvas . requestRenderAll ( ) ;
46
47
} ) ;
47
48
this . editor . off ( 'loadJson' , this . initMask ) ;
48
49
}
49
50
}
51
+ /**
52
+ * @desc 获取蒙版开关
53
+ */
54
+ getworkspaceMaskStatus ( ) {
55
+ return this . coverMask !== null ;
56
+ }
50
57
51
58
/**
52
59
* @desc 获取蒙版
Original file line number Diff line number Diff line change @@ -22,6 +22,10 @@ const openMask = ref(false);
22
22
const onMaskChange = () => {
23
23
canvasEditor ?.workspaceMaskToggle ();
24
24
};
25
+
26
+ onMounted (() => {
27
+ openMask .value = canvasEditor ?.getworkspaceMaskStatus ();
28
+ });
25
29
</script >
26
30
27
31
<style lang="less" scoped>
You can’t perform that action at this time.
0 commit comments