You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* If the <var>dir</var> is left or right, height of <var>intersectRect</var> / the height of the candidate
1276
+
* Else if the <var>dir</var> is up or down, width of <var>intersectRect</var> / the width of the candidate
1277
+
1278
+
* <var>alignWeight</var> is 5
1279
+
1280
+
<dt><var>displacement</var>:
1281
+
<dd>The degree of displacement in <var>dir</var> between <var>searchOrigin</var> and <var>candidate</var>
1282
+
<dd>formula = (absolute distance on the axis orthogonal to <var>dir</var> + <var>orthogonalBias</var>) * <var>orthogonalWeight</var>
1283
+
1284
+
* <var>orthogonalBias</var>:
1285
+
* If the <var>dir</var> is left or right, height of <var>searchOrigin</var> / 2
1286
+
* Else if the <var>dir</var> is up or down, width of <var>searchOrigin</var> / 2
1287
+
1288
+
* <var>orthogonalWeight</var>:
1289
+
* If the <var>dir</var> is left or right, 30
1290
+
* Else if the <var>dir</var> is up or down, 2
1291
+
1292
+
<dt><var>sqrt(Overlap)</var>:
1293
+
<dd>The square root of the <var>intersectRect</var>(overlapped area) between the <a>boundary boxes</a> of <var>candidate</var> and <var>searchOrigin</var>
1294
+
<dd>formula = sqrt(height of <var>intersectRect</var> * width of <var>intersectRect</var>)
1295
+
</dl>
1272
1296
1297
+
NOTE: The values of <var>alignWeight</var> and <var>orthogonalWeight</var> in the function are decided based on
1298
+
the collected <a href="https://wicg.github.io/spatial-navigation/tests/ux/list.html">UX test cases</a>.
1299
+
It aims to show the general expected result in the real pages.
1300
+
Everyone is welcome to contribute to the test cases!
0 commit comments