mirror of
https://github.com/hakimel/reveal.js.git
synced 2025-08-01 20:30:29 +02:00
rerun r-fit-text based on printed slide size, fixes overflow when printing to PDF #2865
This commit is contained in:
@@ -167,11 +167,20 @@ export default class SlideContent {
|
||||
|
||||
}
|
||||
|
||||
this.layout( slide );
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Applies JS-dependent layout helpers for the given slide,
|
||||
* if there are any.
|
||||
*/
|
||||
layout( slide ) {
|
||||
|
||||
// Autosize text with the r-fit-text class based on the
|
||||
// size of its container. This needs to happen after the
|
||||
// slide is visible in order to measure the text.
|
||||
Array.from( slide.querySelectorAll( '.r-fit-text:not([data-fitted])' ) ).forEach( element => {
|
||||
element.dataset.fitted = '';
|
||||
Array.from( slide.querySelectorAll( '.r-fit-text' ) ).forEach( element => {
|
||||
fitty( element, {
|
||||
minSize: 24,
|
||||
maxSize: this.Reveal.getConfig().height * 0.8,
|
||||
|
Reference in New Issue
Block a user