Skip to content

Commit 1e69fca

Browse files
committed
fix(track-prop): clear canvas on setting to false
If the value of the track prop is changed to `false` at run time, the tracking layer canvas is not cleared. Hence paint can persist on the tracking layer in this case.
1 parent f93e534 commit 1e69fca

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

src/components/QrcodeStream.vue

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ export default {
8383
if (this.track === true) {
8484
return thinSquare({ color: "#ff0000" });
8585
} else if (this.track === false) {
86-
return null;
86+
return undefined;
8787
} else {
8888
return this.track;
8989
}
@@ -192,12 +192,10 @@ export default {
192192
},
193193
194194
onLocate(location) {
195-
if (this.trackRepaintFunction !== null) {
196-
if (location === null) {
197-
this.clearTrackingLayer();
198-
} else {
199-
this.repaintTrackingLayer(location);
200-
}
195+
if (this.trackRepaintFunction === undefined || location === null) {
196+
this.clearTrackingLayer();
197+
} else {
198+
this.repaintTrackingLayer(location);
201199
}
202200
},
203201

0 commit comments

Comments
 (0)