The print preview leaves writing space short by the margins of hidden headers, footers and solutions
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 78/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- javascript
Línea de trabajo
Empieza por getElementTotalHeight() en js/src/pretext-printouts.js y sigue sus siete llamadas, especialmente adjustWorkspaceToFitPage() y measureRows(). Reproduce el área de escritura demasiado pequeña con el artículo de ejemplo en headless Chromium, en papel Letter y con los encabezados y pies de página desactivados. El trabajo estará terminado cuando los elementos ocultos ya no contribuyan incorrectamente a los márgenes, los saltos de página sigan siendo adecuados y las impresiones indicadas tengan el espacio de escritura esperado.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
@oscarlevin, this turned up while reviewing #3327, but it is on master and is not from that pull request.
The print preview stretches writing space so that each sheet is full, but every sheet with writing space stops about 30 pixels (0.3 inch) short, and about 15 pixels more for each hint, answer or solution hidden on that sheet.
getElementTotalHeight(), in js/src/pretext-printouts.js, adds an element's top and bottom margins as getComputedStyle() reports them, and those are not zero for an element that is not displayed. adjustWorkspaceToFitPage() adds this up over every child of a sheet, and so counts:
- the header and footer bands, which every sheet carries and which stay hidden unless the reader switches them on: a bottom margin of 14.67 pixels on the header and a top margin of 14.67 pixels on the footer;
- each hidden hint, answer or solution row: about 15 pixels, 22 for some.
The room it gives the writing space is short by that total, and the sheet ends with that much left blank at the foot. With headers and footers switched on, the bands are displayed and their margins are real, so they are counted correctly then.
measureRows() takes row heights from the same function, so the page-break planner is also charged the margins of a hidden row, though the comment there says such a row has height 0. The function has seven callers in all.
Measured on master (06a9be75b) with the sample article in headless Chromium, on Letter paper with headers and footers off: the blank room at the foot of a sheet, and the same with one line added at the top of getElementTotalHeight(), if (style.display === 'none') return 0;. The line moves no page break in these printouts. All figures are in pixels.
| printout | hidden rows on the sheet | blank at the foot, master | with the line |
|---|---|---|---|
worksheet-workspace, sheets 1 to 4 |
0 | 38, 30, 31, 31 | 8, 1, 1, 1 |
worksheet-testing, sheet 1 |
1 | 52 | 8 |
worksheet-activity-with-task |
1 | 52 | 8 |
project-printout-tasks |
1 | 53 | 9 |
worksheet-geometric-prelude-pages, sheet 2 |
1 | 71 | 19 |
The line is a test, not a proposed fix; the other callers may need a different answer. On the worksheet that #3327 adds, where every task has a solution and the solutions start hidden, a sheet ends up as much as 103 pixels short.
Claude Opus 5.5, acting as a coding assistant for Rob Beezer
- Lenguaje dominante
- XSLT
- Estrellas
- 466
- Forks
- 251
- Merge medio
- 4 min
- PR fusionados (30 d)
- 13
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
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de PreTeXtBook/pretext
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 82/100
PreTeXtBook/pretext#3305 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
PreTeXtBook/pretext#3297 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
PreTeXtBook/pretext#3285 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
PreTeXtBook/pretext#3283 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
PreTeXtBook/pretext#3272 ·
Los mantenedores suelen responder en 1 día
Todos los issues de PreTeXtBook/pretext
Issues similares
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
ScoopInstaller/Extras#19404 ·
Los mantenedores suelen responder en 1 día
-
area: batch
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
inabagumi/shinju-date#7294 ·
Los mantenedores suelen responder en 1 día
-
documentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
streaming-video-technology-alliance/common-media-library#700 ·
Los mantenedores suelen responder en 1 día
-
bot:ai-assisted component:platform-js status:untriaged
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
midnightntwrk/platform-js#35 ·
-
could-have
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100