Skip to content

Commit 1d55c06

Browse files
committed
update
1 parent 42269e9 commit 1d55c06

File tree

5 files changed

+208
-390
lines changed

5 files changed

+208
-390
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,8 @@ export default {
125125
- 模态框的显示和隐藏完全由父级控制,所以用户通过验证后,需要手动隐藏模态框
126126

127127
### 更新日志
128+
2021/10/13 - 1.1.8<br/>
129+
- 修复:解决了一个在safari中无法显示拼图块的问题(safari drawImage看起来像是异步操作)
128130

129131
2021/10/12 - 1.1.7<br/>
130132
- 修复:重复加载图片的问题

README3.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,9 @@ export default {
105105
- 模态框的显示和隐藏完全由父级控制,所以用户通过验证后,需要手动隐藏模态框
106106

107107
### 更新日志
108+
2021/10/13 - 1.0.3<br/>
109+
- 修复:解决了一个在safari中无法显示拼图块的问题(safari drawImage看起来像是异步操作)
110+
-
108111
2021/10/12 - 1.0.2<br/>
109112
- 修复:删除了一个无用的ref变量引用,这个引用可能导致在vue3.2.19及以下的版本中出现问题
110113

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-puzzle-vcode",
3-
"version": "1.1.7",
3+
"version": "1.1.8",
44
"description": "vue 滑动拼图验证码",
55
"main": "dist/main.js",
66
"files": [

src/app.vue

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,8 +321,16 @@ export default {
321321
ctx.fill();
322322
323323
// 将小图赋值给ctx2
324-
ctx2.drawImage(c, this.pinX - 3,this.pinY - 20,this.pinX + this.puzzleBaseSize + 5,this.pinY + this.puzzleBaseSize + 5,
325-
0, this.pinY - 20, this.pinX + this.puzzleBaseSize + 5, this.pinY + this.puzzleBaseSize + 5);
324+
const imgData = ctx.getImageData(
325+
this.pinX - 3, // 为了阴影 是从-3px开始截取,判定的时候要+3px
326+
this.pinY - 20,
327+
this.pinX + this.puzzleBaseSize + 5,
328+
this.pinY + this.puzzleBaseSize + 5
329+
);
330+
ctx2.putImageData(imgData, 0, this.pinY - 20);
331+
332+
// ctx2.drawImage(c, this.pinX - 3,this.pinY - 20,this.pinX + this.puzzleBaseSize + 5,this.pinY + this.puzzleBaseSize + 5,
333+
// 0, this.pinY - 20, this.pinX + this.puzzleBaseSize + 5, this.pinY + this.puzzleBaseSize + 5);
326334
327335
// 清理
328336
ctx.restore();

0 commit comments

Comments
 (0)