Skip to content

Commit a3c265e

Browse files
committed
feat(coarse-pointer): improve style
1 parent d9b9412 commit a3c265e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/Handler.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -384,11 +384,14 @@ class Handler extends Eventful {
384384
if (candidates.length) {
385385
const rStep = 4;
386386
const thetaStep = Math.PI / 12;
387-
for (let r = 0; r < targetSizeHalf && !out.target; r += rStep) {
388-
for (let theta = 0; theta < Math.PI * 2 && !out.target; theta += thetaStep) {
387+
for (let r = 0; r < targetSizeHalf; r += rStep) {
388+
for (let theta = 0; theta < Math.PI * 2; theta += thetaStep) {
389389
const x1 = x + r * Math.cos(theta);
390390
const y1 = y + r * Math.sin(theta);
391391
setHoverTarget(candidates, out, x1, y1, exclude);
392+
if (out.target) {
393+
return out;
394+
}
392395
}
393396
}
394397
}

0 commit comments

Comments
 (0)