fix(web): PDF adjust — remove the leftover line-band filter from the endpoint drag
Release / build-and-push (push) Successful in 2m39s

The "full 2D" commit (5a0d9e0) added the tip aim but never removed the
y-band candidate filter from pdfAdjustHandleMove — vertical handle
drags still snapped to the boundary rect's own line, so up/down
movement was impossible (the user's original report). With the filter
gone: the end handle drags down a line and the extent extends with
clean text — verified with real touch on the emulator (down one line,
release, PUT applied: 6 per-line rects).
This commit is contained in:
John O'Keefe committed 2026-10-11 20:44:32 -04:00
1 parent 5a0d9e0e17
commit cbdddc095e
1 file changed
+9 -14
+9 -14
View File
@@ -1855,27 +1855,22 @@ document.addEventListener("alpine:init", () => {
if (!ctx) return; if (!ctx) return;
const map = this.pdfPageMapping(ctx.index); const map = this.pdfPageMapping(ctx.index);
if (!map) return; if (!map) return;
const { fx } = map.toFraction(clientX, clientY); const { fx, fy } = map.toFraction(clientX, clientY);
const chars = ctx.chars; const chars = ctx.chars;
if (!chars.length) return; if (!chars.length) return;
// The boundary stays on its OWN line: candidates are the chars in // Full 2D nearest glyph: the tip crosses lines freely (up/down)
// the boundary rect's line band, and the finger's X picks the // and moves along them (side to side). No line-band pin — the
// glyph (vertical finger movement is ignored — cross-line changes // lifted handle's finger sits above the text, and a y-band filter
// go through re-selection). A whole-table Euclidean scan here // here made vertical drags impossible (user report). Sliver rects
// re-anchored onto the line ABOVE when the finger floated above // stay impossible: the extent is a contiguous char span and the
// the text (lifted handles). // rects are its per-line unions.
const boundary =
which === "start" ? ctx.rects[0] : ctx.rects[ctx.rects.length - 1];
const bandTop = boundary[1] - 0.002;
const bandBottom = boundary[1] + boundary[3] + 0.002;
let best = 0; let best = 0;
let bestD = Infinity; let bestD = Infinity;
for (let i = 0; i < chars.length; i++) { for (let i = 0; i < chars.length; i++) {
const c = chars[i]; const c = chars[i];
const cy = (c.y0 + c.y1) / 2;
if (cy < bandTop || cy > bandBottom) continue;
const cx = (c.x0 + c.x1) / 2; const cx = (c.x0 + c.x1) / 2;
const d = (cx - fx) * (cx - fx); const cy = (c.y0 + c.y1) / 2;
const d = (cx - fx) * (cx - fx) + (cy - fy) * (cy - fy);
if (d < bestD) { if (d < bestD) {
bestD = d; bestD = d;
best = i; best = i;