INNER CODE UNIT · TypeScript
y
hyscaler/HyCanvas · packages/a11y/src/index.ts:110
const y = (t.y ?? 0) + sin * sx * px + cos * sy * py;
top = Math.min(top, y);
cx += x / 4;
cy += y / 4;
}
return { cx, top, cy };
};
let backward = 0;
for (let i = 1; i < ordered.length; i++) {
const prev = center(ordered[i - 1]);
const next = center(ordered[i]);
// A clear backward jump: the next announced element sits entirely ABOVE
// the previous one's row, or on the same row but behind it in the
// document's reading direction. Column layouts survive: reading a
// second column top-to-bottom produces only ONE upward jump.
const above = next.cy < prev.top;
const sameRow = !above && Math.abs(next.cy - prev.cy) < 8;
const behind = sameRow && (rtl ? next.cx > prev.cx : next.cx < prev.cx);