BUG: Marquee Zoom offset and erratic Ctrl + Scroll Zoom on rotated CAD-generated PDF files

Abierto
#696 0 comentarios 2 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
28/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Tranquilo
Stack tecnológico
react, typescript
Área
frontend

Línea de trabajo

Start by reproducing both symptoms with the attached CAD PDF (page rotation metadata) in the viewer, since the issue gives steps but names no file. Look for where marquee-zoom drag rectangles and Ctrl+scroll wheel deltas are converted into page coordinates, and how page rotation is applied there; issue #695 (callout placement on rotated pages) is flagged as the same transformation problem. Done means marquee zoom lands on the dragged area and Ctrl+scroll zooms in smooth, predictable steps on that PDF.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Describe the Bug

There are two related zoom issues when viewing specific PDF files. This behavior occurs on PDF files generated from CAD software that contain page rotation metadata (e.g., pages that appear landscape but have a built-in rotation angle).

  1. Marquee Zoom Offset: When using the Marquee Zoom tool to zoom into a specific selected area, the viewer zooms into a completely different, incorrect area on the page. The coordinate mapping seems shifted or rotated.
  2. Erratic Ctrl + Scroll Zoom: Using Ctrl + Scroll to zoom in/out is not smooth at all. The zoom level jumps aggressively and feels way too fast/sensitive.

Note: This seems closely related to the coordinate transformation issues on rotated PDFs, similar to the Callout issue reported in #695.

Steps to Reproduce

For Marquee Zoom:

  1. Open the attached CAD PDF file in the viewer.
  2. Select the Marquee Zoom tool.
  3. Click and drag a box around a specific area you want to zoom into.
  4. Observe that the view jumps to a different portion of the page instead of the selected area.

For Ctrl + Scroll Zoom:

  1. Hold Ctrl and scroll the mouse wheel to zoom in or out.
  2. Observe that the zoom is extremely sensitive, choppy, and jumps in large increments.

Expected Behavior

  • Marquee Zoom: The viewer should precisely zoom into the area selected by the drag box, correctly accounting for any page rotation metadata.
  • Ctrl + Scroll Zoom: The zoom transition should be smooth, predictable, and at a reasonable speed.

Actual Behavior

  • Marquee Zoom targets the wrong coordinates.
  • Ctrl + Scroll zoom is jittery, overly sensitive, and hard to control.

Environment

  • Library Version: v2.14.4
  • Framework: React
  • Browser: Chrome
  • OS: Windows

Additional Context & Attachments

I have attached the sample PDF, along with screenshots and a screen recording showing both the Marquee Zoom offset and the choppy Ctrl + Scroll behavior.

https://github.com/user-attachments/assets/a33b41c0-8940-4179-8c51-117cb857efc3

Image
Lenguaje dominante
TypeScript
Estrellas
4.5k
Forks
317
Merge medio
10 h 16 min
PR fusionados (30 d)
174

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de embedpdf/embed-pdf-viewer

Todos los issues de embedpdf/embed-pdf-viewer

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.