airayven7 commited on
Commit
d3bb78b
Β·
verified Β·
1 Parent(s): a86d9d6

Sync from GitHub 536fc71

Browse files
Files changed (1) hide show
  1. frontend/index.html +11 -2
frontend/index.html CHANGED
@@ -265,7 +265,7 @@
265
  <template x-for="p in spreadPages" :key="p">
266
  <div class="relative flex-1 min-w-0 grid place-items-center">
267
  <img :src="`/page/${encodeURIComponent(viewDoc)}/${p}?v=__PAGE_V__`"
268
- @load="nat[p]={w:$event.target.naturalWidth,h:$event.target.naturalHeight}; if(p===viewPage){imgW=$event.target.naturalWidth; imgH=$event.target.naturalHeight;}"
269
  class="col-start-1 row-start-1 block max-h-full max-w-full w-auto h-auto select-none rounded-lg shadow-sm ring-1 ring-navy/10"
270
  draggable="false" alt="manual page">
271
  <!-- box overlay: a rounded rectangle hugging the grounded region,
@@ -668,7 +668,16 @@ function repairGuy() {
668
  this.recordHistory(ev.message||'done');
669
  }else if(ev.found){ // point
670
  this.setPage(ev.page);
671
- if(ev.bbox){ this.circle={page:ev.page, bbox:ev.bbox, dims:ev.dims}; find.icon='target'; find.label=`Circled β€œ${ev.target}”`; this.recordHistory(`circled β€œ${ev.target}” on p.${ev.page}`); }
 
 
 
 
 
 
 
 
 
672
  else { find.icon='file-text'; find.label=`Showed β€œ${ev.target}”`; this.recordHistory(`showed β€œ${ev.target}” on p.${ev.page}`); } // page found, not pinpointed
673
  find.detail=`p.${ev.page}${meta}`;
674
  }else{
 
265
  <template x-for="p in spreadPages" :key="p">
266
  <div class="relative flex-1 min-w-0 grid place-items-center">
267
  <img :src="`/page/${encodeURIComponent(viewDoc)}/${p}?v=__PAGE_V__`"
268
+ @load="nat[p]={w:$event.target.naturalWidth,h:$event.target.naturalHeight}; if(p===viewPage){imgW=$event.target.naturalWidth; imgH=$event.target.naturalHeight;} console.log('[page-load]', p, $event.target.naturalWidth+'x'+$event.target.naturalHeight, $event.target.currentSrc)"
269
  class="col-start-1 row-start-1 block max-h-full max-w-full w-auto h-auto select-none rounded-lg shadow-sm ring-1 ring-navy/10"
270
  draggable="false" alt="manual page">
271
  <!-- box overlay: a rounded rectangle hugging the grounded region,
 
668
  this.recordHistory(ev.message||'done');
669
  }else if(ev.found){ // point
670
  this.setPage(ev.page);
671
+ if(ev.bbox){ this.circle={page:ev.page, bbox:ev.bbox, dims:ev.dims};
672
+ // DIAGNOSTIC: is the live overlay using the backend grounding dims?
673
+ // dimsFromBackend null -> server not sending dims (restart it).
674
+ // natLoaded β‰  dimsFromBackend -> displayed page PNG is a different
675
+ // (e.g. stale/half) resolution than what the box was grounded on;
676
+ // boxDimsUsed is what the SVG viewBox actually uses to place the box.
677
+ console.log('[circle-diag]', {page:ev.page, bbox:ev.bbox,
678
+ dimsFromBackend:ev.dims, natLoaded:this.nat[ev.page],
679
+ boxDimsUsed:this.boxDims(ev.page), usingBackendDims:!!ev.dims});
680
+ find.icon='target'; find.label=`Circled β€œ${ev.target}”`; this.recordHistory(`circled β€œ${ev.target}” on p.${ev.page}`); }
681
  else { find.icon='file-text'; find.label=`Showed β€œ${ev.target}”`; this.recordHistory(`showed β€œ${ev.target}” on p.${ev.page}`); } // page found, not pinpointed
682
  find.detail=`p.${ev.page}${meta}`;
683
  }else{