@@ -27,6 +27,10 @@ export default function createGrid(
27
27
) {
28
28
// Prevent multiple calls per run
29
29
if ( cache . get ( 'gridCreated' ) && ! parentVNode ) {
30
+ // a11y-engine-domforge change
31
+ if ( cache . get ( 'gridSize' ) ) {
32
+ return cache . get ( 'gridSize' ) ;
33
+ }
30
34
return constants . gridSize ;
31
35
}
32
36
cache . set ( 'gridCreated' , true ) ;
@@ -110,6 +114,11 @@ export default function createGrid(
110
114
111
115
node = treeWalker . nextNode ( ) ;
112
116
}
117
+
118
+ // a11y-engine-domforge change
119
+ if ( cache . get ( 'gridSize' ) ) {
120
+ return cache . get ( 'gridSize' ) ;
121
+ }
113
122
return constants . gridSize ;
114
123
}
115
124
@@ -430,6 +439,10 @@ class Grid {
430
439
* @returns {number }
431
440
*/
432
441
toGridIndex ( num ) {
442
+ // a11y-engine-domforge change
443
+ if ( cache . get ( 'gridSize' ) ) {
444
+ return Math . floor ( num / cache . get ( 'gridSize' ) ) ;
445
+ }
433
446
return Math . floor ( num / constants . gridSize ) ;
434
447
}
435
448
@@ -442,10 +455,18 @@ class Grid {
442
455
assert ( this . boundaries , 'Grid does not have cells added' ) ;
443
456
const rowIndex = this . toGridIndex ( y ) ;
444
457
const colIndex = this . toGridIndex ( x ) ;
445
- assert (
446
- isPointInRect ( { y : rowIndex , x : colIndex } , this . boundaries ) ,
447
- 'Element midpoint exceeds the grid bounds'
448
- ) ;
458
+
459
+ // a11y-engine-domforge change
460
+ if ( cache . get ( 'ruleId' ) === 'resize-2x-zoom' ) {
461
+ if ( ! isPointInRect ( { y : rowIndex , x : colIndex } , this . boundaries ) ) {
462
+ return [ ] ;
463
+ }
464
+ } else {
465
+ assert (
466
+ isPointInRect ( { y : rowIndex , x : colIndex } , this . boundaries ) ,
467
+ 'Element midpoint exceeds the grid bounds'
468
+ ) ;
469
+ }
449
470
const row = this . cells [ rowIndex - this . cells . _negativeIndex ] ?? [ ] ;
450
471
return row [ colIndex - row . _negativeIndex ] ?? [ ] ;
451
472
}
0 commit comments