Description
The slide scaler in src/mdeck/scaler.ts computes the scale factor using the ratio option (e.g. 4:3, 16:9), but there is no way to set the reference dimensions in pixels. Consumers who need pixel-perfect scaling (e.g. to match a specific output format like 1280×720) must resort to CSS hacks.
Proposed API
Add referenceWidth and referenceHeight options (in pixels) to SlideshowOptions:
mdeck.createSlideshow({
referenceWidth: 1280,
referenceHeight: 720,
});
When set, these take precedence over the ratio string for computing the scale factor. Default values should preserve existing behaviour (908 × 681 for 4:3, matching the current implementation).
Use cases
- Generating slide screenshots / PDFs at a known pixel size
- Matching a projector's native resolution exactly
- Embedding slides in a fixed-size iframe
Ported from gnab/remark#700
Description
The slide scaler in
src/mdeck/scaler.tscomputes the scale factor using the ratio option (e.g.4:3,16:9), but there is no way to set the reference dimensions in pixels. Consumers who need pixel-perfect scaling (e.g. to match a specific output format like 1280×720) must resort to CSS hacks.Proposed API
Add
referenceWidthandreferenceHeightoptions (in pixels) toSlideshowOptions:When set, these take precedence over the
ratiostring for computing the scale factor. Default values should preserve existing behaviour (908 × 681 for 4:3, matching the current implementation).Use cases
Ported from gnab/remark#700